aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/app/controller/admin/bodies.t11
-rw-r--r--t/app/controller/report_new.t5
-rw-r--r--t/open311/populate-service-list.t23
3 files changed, 14 insertions, 25 deletions
diff --git a/t/app/controller/admin/bodies.t b/t/app/controller/admin/bodies.t
index f67e45bf6..d2ae28e9d 100644
--- a/t/app/controller/admin/bodies.t
+++ b/t/app/controller/admin/bodies.t
@@ -1,10 +1,3 @@
-package FixMyStreet::Cobrand::Tester;
-
-use parent 'FixMyStreet::Cobrand::Default';
-
-sub enable_category_groups { 1 }
-
-package main;
use FixMyStreet::TestMech;
my $mech = FixMyStreet::TestMech->new;
@@ -210,10 +203,12 @@ subtest 'check text output' => sub {
}; # END of override wrap
FixMyStreet::override_config {
- ALLOWED_COBRANDS => ['tester'],
MAPIT_URL => 'http://mapit.uk/',
MAPIT_TYPES => [ 'UTA' ],
BASE_URL => 'http://www.example.org',
+ COBRAND_FEATURES => {
+ category_groups => { default => 1 },
+ }
}, sub {
subtest 'group editing works' => sub {
$mech->get_ok('/admin/body/' . $body->id);
diff --git a/t/app/controller/report_new.t b/t/app/controller/report_new.t
index 848529686..d6b256be1 100644
--- a/t/app/controller/report_new.t
+++ b/t/app/controller/report_new.t
@@ -1271,11 +1271,12 @@ subtest "Test inactive categories" => sub {
};
subtest "category groups" => sub {
- my $cobrand = Test::MockModule->new('FixMyStreet::Cobrand::FixMyStreet');
- $cobrand->mock('enable_category_groups', sub { 1 });
FixMyStreet::override_config {
ALLOWED_COBRANDS => 'fixmystreet',
MAPIT_URL => 'http://mapit.uk/',
+ COBRAND_FEATURES => {
+ category_groups => { fixmystreet => 1 }
+ }
}, sub {
$contact2->update( { extra => { group => 'Roads' } } );
$contact9->update( { extra => { group => 'Roads' } } );
diff --git a/t/open311/populate-service-list.t b/t/open311/populate-service-list.t
index c67fae9bd..fc3423ae6 100644
--- a/t/open311/populate-service-list.t
+++ b/t/open311/populate-service-list.t
@@ -5,16 +5,6 @@ use parent 'FixMyStreet::Cobrand::Default';
sub council_area_id { 1 }
-
-package FixMyStreet::Cobrand::TesterGroups;
-
-use parent 'FixMyStreet::Cobrand::Default';
-
-sub council_area_id { 1 }
-
-sub enable_category_groups { 1 }
-
-
package main;
use FixMyStreet::Test;
@@ -51,13 +41,16 @@ $bucks->body_areas->create({
});
for my $test (
- { desc => 'groups not set for new contacts', cobrand => 'tester', groups => 0, delete => 1 },
- { desc => 'groups set for new contacts', cobrand => 'testergroups', groups => 1, delete => 1},
- { desc => 'groups removed for existing contacts', cobrand => 'tester', groups => 0, delete => 0 },
- { desc => 'groups added for existing contacts', cobrand => 'testergroups', groups => 1, delete => 0},
+ { desc => 'groups not set for new contacts', enable_groups => 0, groups => 0, delete => 1 },
+ { desc => 'groups set for new contacts', enable_groups => 1, groups => 1, delete => 1},
+ { desc => 'groups removed for existing contacts', enable_groups => 0, groups => 0, delete => 0 },
+ { desc => 'groups added for existing contacts', enable_groups => 1, groups => 1, delete => 0},
) {
FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ $test->{cobrand} ],
+ ALLOWED_COBRANDS => [ 'tester' ],
+ COBRAND_FEATURES => {
+ category_groups => { tester => $test->{enable_groups} },
+ }
}, sub {
subtest 'check basic functionality, ' . $test->{desc} => sub {
FixMyStreet::DB->resultset('Contact')->search( { body_id => $body->id } )->delete() if $test->{delete};