diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-03-06 15:40:16 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-03-07 13:13:38 +0000 |
commit | 1511fd51adef54ec93759ef256ca9f3ce3646adb (patch) | |
tree | 114e66d02011c85734157a8ab134217ec54ee8bf /t/app/controller | |
parent | 11edb2b5d154ece38506e853c95f1cb2df67c0e2 (diff) |
[Zurich] Switch to more modern database states.
The Zurich code was written a long time ago, and used overriding so that
e.g. the hard-coded 'investigating' state referred to Wunsch (wish). Now
that states are stored in the database, we can create ones specially for
Zurich and use them instead. Hooray!
Diffstat (limited to 't/app/controller')
-rw-r--r-- | t/app/controller/report_display.t | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/t/app/controller/report_display.t b/t/app/controller/report_display.t index f0913fbd2..605371ed7 100644 --- a/t/app/controller/report_display.t +++ b/t/app/controller/report_display.t @@ -419,106 +419,6 @@ for my $test ( }; } -subtest "Zurich unconfirmeds are 200" => sub { - FixMyStreet::override_config { - ALLOWED_COBRANDS => [ 'zurich' ], - MAP_TYPE => 'Zurich,OSM', - }, sub { - $mech->host( 'zurich.example.com' ); - ok $report->update( { state => 'unconfirmed' } ), 'unconfirm report'; - $mech->get_ok("/report/$report_id"); - $mech->content_contains( 'Überprüfung ausstehend' ); - ok $report->update( { state => 'confirmed' } ), 'confirm report again'; - $mech->host( 'www.fixmystreet.com' ); - }; -}; - -subtest "Zurich banners are displayed correctly" => sub { - FixMyStreet::override_config { - ALLOWED_COBRANDS => [ 'zurich' ], - MAP_TYPE => 'Zurich,OSM', - }, sub { - $mech->host( 'zurich.example.com' ); - - for my $test ( - { - description => 'new report', - state => 'unconfirmed', - banner_id => 'closed', - banner_text => 'Erfasst' - }, - { - description => 'confirmed report', - state => 'confirmed', - banner_id => 'closed', - banner_text => 'Aufgenommen', - }, - { - description => 'fixed report', - state => 'fixed - council', - banner_id => 'fixed', - banner_text => 'Beantwortet', - }, - { - description => 'closed report', - state => 'closed', - banner_id => 'closed', - banner_text => _('Extern'), - }, - { - description => 'in progress report', - state => 'in progress', - banner_id => 'progress', - banner_text => 'In Bearbeitung', - }, - { - description => 'planned report', - state => 'planned', - banner_id => 'progress', - banner_text => 'In Bearbeitung', - }, - { - description => 'planned report', - state => 'planned', - banner_id => 'progress', - banner_text => 'In Bearbeitung', - }, - { - description => 'jurisdiction unknown', - state => 'unable to fix', - banner_id => 'fixed', - # We can't use _('Jurisdiction Unknown') here because - # TestMech::extract_problem_banner decodes the HTML entities before - # the string is passed back. - banner_text => 'Zust\x{e4}ndigkeit unbekannt', - }, - ) { - subtest "banner for $test->{description}" => sub { - $report->state( $test->{state} ); - $report->update; - - $mech->get_ok("/report/$report_id"); - is $mech->uri->path, "/report/$report_id", "at /report/$report_id"; - my $banner = $mech->extract_problem_banner; - if ( $banner->{text} ) { - $banner->{text} =~ s/^ //g; - $banner->{text} =~ s/ $//g; - } - - is $banner->{id}, $test->{banner_id}, 'banner id'; - if ($test->{banner_text}) { - like_string( $banner->{text}, qr/$test->{banner_text}/i, 'banner text is ' . $test->{banner_text} ); - } else { - is $banner->{text}, $test->{banner_text}, 'banner text'; - } - - }; - } - - $mech->host( 'www.fixmystreet.com' ); - }; -}; - my $oxfordshire = $mech->create_body_ok(2237, 'Oxfordshire County Council'); my $oxfordshireuser = $mech->create_user_ok('counciluser@example.com', name => 'Council User', from_body => $oxfordshire); |