aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/cobrand/bexley.t16
-rw-r--r--t/cobrand/hounslow.t17
2 files changed, 28 insertions, 5 deletions
diff --git a/t/cobrand/bexley.t b/t/cobrand/bexley.t
index e6f400e3d..2f74ac03a 100644
--- a/t/cobrand/bexley.t
+++ b/t/cobrand/bexley.t
@@ -12,10 +12,18 @@ $ukc->mock('lookup_site_code', sub {
return "Road ID";
});
-my $cobrand = FixMyStreet::Cobrand::Bexley->new;
-like $cobrand->contact_email, qr/bexley/;
-is $cobrand->on_map_default_status, 'open';
-is_deeply $cobrand->disambiguate_location->{bounds}, [ 51.408484, 0.074653, 51.515542, 0.2234676 ];
+FixMyStreet::override_config {
+ COBRAND_FEATURES => {
+ contact_email => {
+ bexley => 'foo@bexley',
+ }
+ },
+}, sub {
+ my $cobrand = FixMyStreet::Cobrand::Bexley->new;
+ like $cobrand->contact_email, qr/bexley/;
+ is $cobrand->on_map_default_status, 'open';
+ is_deeply $cobrand->disambiguate_location->{bounds}, [ 51.408484, 0.074653, 51.515542, 0.2234676 ];
+};
my $mech = FixMyStreet::TestMech->new;
diff --git a/t/cobrand/hounslow.t b/t/cobrand/hounslow.t
index 417bc7736..8fac848b1 100644
--- a/t/cobrand/hounslow.t
+++ b/t/cobrand/hounslow.t
@@ -9,6 +9,8 @@ $mech->create_contact_ok(
email => 'pothole@example.org',
);
+$mech->create_user_ok('staff@example.org', from_body => $hounslow_id);
+
my $tfl = $mech->create_body_ok( 2483, 'TfL');
$mech->create_contact_ok(
body_id => $tfl->id,
@@ -23,7 +25,8 @@ $mech->create_problems_for_body(1, $hounslow_id, 'An old problem made before Hou
$mech->create_problems_for_body(1, $hounslow_id, 'A brand new problem made on the Hounslow site', {
cobrand => 'hounslow'
});
-$mech->create_problems_for_body(1, $hounslow_id, 'A brand new problem made on fixmystreet.com', {
+my ($report) = $mech->create_problems_for_body(1, $hounslow_id, 'A brand new problem made on fixmystreet.com', {
+ external_id => 'ABC123',
cobrand => 'fixmystreet'
});
@@ -63,4 +66,16 @@ subtest "does not show TfL traffic lights category" => sub {
};
};
+subtest "Shows external ID on report page to staff users only" => sub {
+ FixMyStreet::override_config {
+ ALLOWED_COBRANDS => 'hounslow',
+ }, sub {
+ $mech->get_ok('/report/' . $report->id);
+ $mech->content_lacks('ABC123');
+ $mech->log_in_ok('staff@example.org');
+ $mech->get_ok('/report/' . $report->id);
+ $mech->content_contains('ABC123');
+ };
+};
+
done_testing();