diff options
author | M Somerville <matthew-github@dracos.co.uk> | 2020-10-19 11:05:04 +0100 |
---|---|---|
committer | M Somerville <matthew-github@dracos.co.uk> | 2020-11-11 10:29:20 +0000 |
commit | bc19b9e00f3d59a2f0694f2fcc3aab54fef35e9e (patch) | |
tree | 0d94dd0934cc237d6fa02cc98db6d2a5527f8ff9 /t/app/controller/waste.t | |
parent | c0f9b0dcb1fc7cecb4b98ad82715600f73707bf0 (diff) |
[Bromley] ICal generation.
Diffstat (limited to 't/app/controller/waste.t')
-rw-r--r-- | t/app/controller/waste.t | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/t/app/controller/waste.t b/t/app/controller/waste.t index bbd0cd00a..9bc03e169 100644 --- a/t/app/controller/waste.t +++ b/t/app/controller/waste.t @@ -116,6 +116,18 @@ FixMyStreet::override_config { $mech->get_ok('/waste/uprn/1000000002/enquiry?service=1'); is $mech->uri->path, '/waste/uprn/1000000002'; }; + subtest 'Checking calendar' => sub { + $mech->follow_link_ok({ text => 'Add to your calendar (.ics file)' }); + $mech->content_contains('BEGIN:VCALENDAR'); + my @events = split /BEGIN:VEVENT/, $mech->encoded_content; + shift @events; # Header + my $i = 0; + foreach (@events) { + $i++ if /DTSTART;VALUE=DATE:20200701/ && /SUMMARY:Refuse collection/; + $i++ if /DTSTART;VALUE=DATE:20200708/ && /SUMMARY:Paper & Cardboard/; + } + is $i, 2, 'Two events from the sample data in the calendar'; + }; subtest 'General enquiry, on behalf of someone else' => sub { $mech->log_in_ok($staff_user->email); $mech->get_ok('/waste/uprn/1000000002/enquiry?category=General+enquiry&service_id=537'); |