aboutsummaryrefslogtreecommitdiffstats
path: root/t/cobrand
diff options
context:
space:
mode:
Diffstat (limited to 't/cobrand')
-rw-r--r--t/cobrand/northamptonshire.t41
1 files changed, 41 insertions, 0 deletions
diff --git a/t/cobrand/northamptonshire.t b/t/cobrand/northamptonshire.t
new file mode 100644
index 000000000..3331f0c99
--- /dev/null
+++ b/t/cobrand/northamptonshire.t
@@ -0,0 +1,41 @@
+use Test::MockModule;
+
+use FixMyStreet::TestMech;
+my $mech = FixMyStreet::TestMech->new;
+
+use open ':std', ':encoding(UTF-8)';
+
+my $ncc = $mech->create_body_ok(2234, 'Northamptonshire County Council');
+my $nbc = $mech->create_body_ok(2397, 'Northampton Borough Council');
+
+my $ncc_contact = $mech->create_contact_ok(
+ body_id => $ncc->id,
+ category => 'Trees',
+ email => 'trees-2234@example.com',
+);
+
+my $nbc_contact = $mech->create_contact_ok(
+ body_id => $nbc->id,
+ category => 'Flytipping',
+ email => 'flytipping-2397@example.com',
+);
+
+subtest 'Check district categories hidden on cobrand' => sub {
+ FixMyStreet::override_config {
+ ALLOWED_COBRANDS => [ { northamptonshire => '.' } ],
+ MAPIT_URL => 'http://mapit.uk/',
+ }, sub {
+ $mech->get_ok( '/around' );
+ $mech->submit_form_ok( { with_fields => { pc => 'NN1 1NS' } },
+ "submit location" );
+ is_deeply $mech->page_errors, [], "no errors for pc";
+
+ $mech->follow_link_ok( { text_regex => qr/skip this step/i, },
+ "follow 'skip this step' link" );
+
+ $mech->content_contains('Trees');
+ $mech->content_lacks('Flytipping');
+ };
+};
+
+done_testing();