diff options
Diffstat (limited to 't/app/controller')
-rw-r--r-- | t/app/controller/waste.t | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/t/app/controller/waste.t b/t/app/controller/waste.t index 9bc03e169..85536981b 100644 --- a/t/app/controller/waste.t +++ b/t/app/controller/waste.t @@ -1,9 +1,15 @@ +use utf8; use Test::MockModule; +use Test::MockTime qw(:all); use FixMyStreet::TestMech; FixMyStreet::App->log->disable('info'); END { FixMyStreet::App->log->enable('info'); } +# Mock fetching bank holidays +my $uk = Test::MockModule->new('FixMyStreet::Cobrand::UK'); +$uk->mock('_fetch_url', sub { '{}' }); + my $mech = FixMyStreet::TestMech->new; my $body = $mech->create_body_ok(2482, 'Bromley Council'); @@ -44,6 +50,7 @@ FixMyStreet::override_config { $mech->content_contains('can’t find your address'); }; subtest 'Address lookup' => sub { + set_fixed_time('2020-05-28T17:00:00Z'); # After sample data collection $mech->get_ok('/waste'); $mech->submit_form_ok({ with_fields => { postcode => 'BR1 1AA' } }); $mech->submit_form_ok({ with_fields => { address => '1000000002' } }); @@ -51,7 +58,15 @@ FixMyStreet::override_config { $mech->content_contains('Food Waste'); }; subtest 'Report a missed bin' => sub { + $mech->content_contains('service-101', 'Can report, last collection was 27th'); + $mech->content_contains('service-537', 'Can report, last collection was 27th'); + $mech->content_lacks('service-535', 'Cannot report, last collection was 20th'); + $mech->content_lacks('service-542', 'Cannot report, last collection was 18th'); $mech->follow_link_ok({ text => 'Report a missed collection' }); + $mech->content_contains('service-101', 'Checkbox, last collection was 27th'); + $mech->content_contains('service-537', 'Checkbox, last collection was 27th'); + $mech->content_lacks('service-535', 'No checkbox, last collection was 20th'); + $mech->content_lacks('service-542', 'No checkbox, last collection was 18th'); $mech->submit_form_ok({ form_number => 2 }); $mech->content_contains('Please specify what was missed'); $mech->submit_form_ok({ with_fields => { 'service-101' => 1 } }); |