aboutsummaryrefslogtreecommitdiffstats
path: root/t/cobrand
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2019-04-25 14:02:51 +0100
committerStruan Donald <struan@exo.org.uk>2019-09-27 17:18:37 +0100
commiteffcb0f3043f3684e94db4866d0b434440e8ba53 (patch)
treed4c5db0bd5b4baa067f914c15ff25b9933be8f29 /t/cobrand
parent8b962fdf43724c853b5959539b36b4d46b25639f (diff)
[IsleOfWight] Initial cobrand.
Co-authored-by: Matthew Somerville <matthew@mysociety.org> Configured to allow: - updates only from original reporter - close updates from fetch reports - use OSM geocoder
Diffstat (limited to 't/cobrand')
-rw-r--r--t/cobrand/isleofwight.t37
1 files changed, 37 insertions, 0 deletions
diff --git a/t/cobrand/isleofwight.t b/t/cobrand/isleofwight.t
new file mode 100644
index 000000000..c3e5a7810
--- /dev/null
+++ b/t/cobrand/isleofwight.t
@@ -0,0 +1,37 @@
+use FixMyStreet::TestMech;
+
+ok( my $mech = FixMyStreet::TestMech->new, 'Created mech object' );
+
+my $isleofwight_id = $mech->create_body_ok(2636, 'Isle of Wight Council')->id;
+$mech->create_contact_ok(
+ body_id => $isleofwight_id,
+ category => 'Potholes',
+ email => 'pothole@example.org',
+);
+
+my $user = $mech->create_user_ok('user@example.org');
+
+my @reports = $mech->create_problems_for_body(1, $isleofwight_id, 'An Isle of wight report', {
+ confirmed => '2019-05-25 09:00',
+ lastupdate => '2019-05-25 09:00',
+ latitude => 50.7108,
+ longitude => -1.29573,
+ user => $user
+});
+
+subtest "only original reporter can comment" => sub {
+ FixMyStreet::override_config {
+ MAPIT_URL => 'http://mapit.uk/',
+ ALLOWED_COBRANDS => 'isleofwight',
+ }, sub {
+ $mech->get_ok('/report/' . $reports[0]->id);
+ $mech->content_contains('Only the original reporter may leave updates');
+
+ $mech->log_in_ok('user@example.org');
+ $mech->get_ok('/report/' . $reports[0]->id);
+ $mech->content_lacks('Only the original reporter may leave updates');
+ };
+};
+
+
+done_testing();