aboutsummaryrefslogtreecommitdiffstats
path: root/t/cobrand
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2017-08-21 09:54:55 +0100
committerDave Arter <davea@mysociety.org>2017-08-21 09:54:55 +0100
commit6e22df6dd8fbf1504bcedd6a3e77201cf438525d (patch)
tree95f1f126ee3db82c4c7eec7afe27e0b0ad21e592 /t/cobrand
parentbbe8fb87daab16ca285521658bec1dcb2fbdf4d1 (diff)
[Bristol] Fix 500 error on /report/new
Diffstat (limited to 't/cobrand')
-rw-r--r--t/cobrand/bristol.t44
1 files changed, 44 insertions, 0 deletions
diff --git a/t/cobrand/bristol.t b/t/cobrand/bristol.t
new file mode 100644
index 000000000..b4b6ed4ac
--- /dev/null
+++ b/t/cobrand/bristol.t
@@ -0,0 +1,44 @@
+use FixMyStreet::TestMech;
+my $mech = FixMyStreet::TestMech->new;
+
+# Create test data
+my $body = $mech->create_body_ok( 2561, 'Bristol County Council', {
+ send_method => 'Open311',
+ can_be_devolved => 1
+});
+
+my $open311_contact = $mech->create_contact_ok(
+ body_id => $body->id,
+ category => 'Street Lighting',
+ email => 'LIGHT',
+);
+my $email_contact = $mech->create_contact_ok(
+ body_id => $body->id,
+ category => 'Potholes',
+ email => 'potholes@example.org',
+ send_method => 'Email'
+);
+
+subtest 'Only Open311 categories are shown on Bristol cobrand', sub {
+ FixMyStreet::override_config {
+ ALLOWED_COBRANDS => [ 'bristol' ],
+ MAPIT_URL => 'http://mapit.uk/',
+ }, sub {
+ $mech->get_ok("/report/new/ajax?latitude=51.494885&longitude=-2.602237");
+ $mech->content_contains($open311_contact->category);
+ $mech->content_lacks($email_contact->category);
+ };
+};
+
+subtest 'All categories are shown on FMS cobrand', sub {
+ FixMyStreet::override_config {
+ ALLOWED_COBRANDS => [ 'fixmystreet' ],
+ MAPIT_URL => 'http://mapit.uk/',
+ }, sub {
+ $mech->get_ok("/report/new/ajax?latitude=51.494885&longitude=-2.602237");
+ $mech->content_contains($open311_contact->category);
+ $mech->content_contains($email_contact->category);
+ };
+};
+
+done_testing();