diff options
author | Dave Arter <davea@mysociety.org> | 2018-03-15 10:57:57 +0000 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2018-03-15 11:19:41 +0000 |
commit | d5fed14044a348d85061202265dd09e4ce1b776b (patch) | |
tree | 0f15eb42bc554e2beb5448f14c535aeaebc8d342 | |
parent | e1f7ee00b13ca71a2d2197b32dae73d8f703ba6c (diff) |
[Zurich] Fix typo causing crash on /report/ajax
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Zurich.pm | 2 | ||||
-rw-r--r-- | t/cobrand/zurich.t | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm index 7068d3b03..c8af63987 100644 --- a/perllib/FixMyStreet/Cobrand/Zurich.pm +++ b/perllib/FixMyStreet/Cobrand/Zurich.pm @@ -174,7 +174,7 @@ sub updates_as_hashref { my $hashref = {}; - if (problem_has_public_response($problem)) { + if ($self->problem_has_public_response($problem)) { $hashref->{update_pp} = $self->prettify_dt( $problem->lastupdate ); if ( $problem->state ne 'external' ) { diff --git a/t/cobrand/zurich.t b/t/cobrand/zurich.t index f5c6b1145..eccb0c8eb 100644 --- a/t/cobrand/zurich.t +++ b/t/cobrand/zurich.t @@ -126,6 +126,15 @@ FixMyStreet::override_config { $mech->content_contains('Überprüfung ausstehend') or die $mech->content; +FixMyStreet::override_config { + ALLOWED_COBRANDS => [ 'zurich' ], + MAP_TYPE => 'Zurich,OSM', +}, sub { + my $json = $mech->get_ok_json( '/report/ajax/' . $report->id ); + is $json->{report}->{title}, "Überprüfung ausstehend", "correct title"; + is $json->{report}->{state}, "submitted", "correct state"; +}; + subtest "Banners are displayed correctly" => sub { FixMyStreet::override_config { ALLOWED_COBRANDS => [ 'zurich' ], |