diff options
author | Struan Donald <struan@exo.org.uk> | 2017-11-23 14:01:32 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2017-11-28 11:00:53 +0000 |
commit | a1d8db72e57fe74c02ea7da812ea393ceb9b36c6 (patch) | |
tree | 7146ff60d2258cda70f6518b62112f491f414573 /t/cobrand | |
parent | 068dc61ef58b7eab521c9a009f0554fdb98512ed (diff) |
display council contacts on council dashboard
Display a list of the email addresses used to contact the council on the
council dashboard. Does not display emails if the council has an
integration, rejects FMS reports or is currently turned off.
Fixes mysociety/fixmystreetforcouncils#941
Diffstat (limited to 't/cobrand')
-rw-r--r-- | t/cobrand/fixmystreet.t | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/t/cobrand/fixmystreet.t b/t/cobrand/fixmystreet.t index eda93e187..4d76e43c6 100644 --- a/t/cobrand/fixmystreet.t +++ b/t/cobrand/fixmystreet.t @@ -5,6 +5,12 @@ my $mech = FixMyStreet::TestMech->new; my $body = $mech->create_body_ok( 2514, 'Birmingham' ); +my $contact = $mech->create_contact_ok( + body_id => $body->id, + category => 'Traffic lights', + email => 'lights@example.com' +); + my $data; FixMyStreet::override_config { MAPIT_URL => 'http://mapit.uk/', @@ -39,7 +45,27 @@ FixMyStreet::override_config { $mech->get_ok('/about/council-dashboard'); is $mech->uri->path, '/reports/Birmingham/summary'; $mech->content_contains('Top 5 wards'); + $mech->content_contains('Where we send Birmingham'); + $mech->content_contains('lights@example.com'); + + $body->send_method('Open311'); + $body->update(); + $mech->get_ok('/about/council-dashboard'); + $mech->content_contains('Reports to Birmingham are currently sent directly'); + + $body->send_method('Refused'); + $body->update(); + $mech->get_ok('/about/council-dashboard'); + $mech->content_contains('Birmingham currently does not accept'); + + $body->send_method('Noop'); + $body->update(); + $mech->get_ok('/about/council-dashboard'); + $mech->content_contains('Reports are currently not being sent'); + $mech->log_out_ok(); + $mech->get_ok('/reports'); + $mech->content_lacks('Where we send Birmingham'); }; END { |