diff options
author | Matthew Somerville <matthew@mysociety.org> | 2016-07-20 14:58:34 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2016-08-22 10:36:01 +0100 |
commit | bbb067ec5ddc88862be50819076bfe63c744122e (patch) | |
tree | 49a3e2fe62f45848495e41394e37c6536b4def44 /t/app/controller/my.t | |
parent | f3649ee94bb80e8b33f0eea8a817760475157b3b (diff) |
Add user planned reports.
A user with the appropriate permission can add/remove reports from their
list of planned reports using a button on a report page. The list can be
viewed at /my/planned.
Diffstat (limited to 't/app/controller/my.t')
-rw-r--r-- | t/app/controller/my.t | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/t/app/controller/my.t b/t/app/controller/my.t index d24a66c8e..00070ed81 100644 --- a/t/app/controller/my.t +++ b/t/app/controller/my.t @@ -10,16 +10,19 @@ $mech->get_ok('/my'); is $mech->uri->path, '/auth', "got sent to the sign in page"; $mech->create_problems_for_body(1, 1234, 'Test Title'); +my $other_user = FixMyStreet::DB->resultset('User')->find_or_create({ email => 'another@example.com' }); +$mech->create_problems_for_body(1, 1234, 'Another Title', { user => $other_user }); -# sign in my $user = $mech->log_in_ok( 'test@example.com' ); $mech->get_ok('/my'); -is $mech->uri->path, '/my', "stayed on '/my/' page"; +is $mech->uri->path, '/my', "stayed on '/my' page"; -# Report listed $mech->content_contains('Test Title'); +$mech->content_lacks('Another Title'); -# cleanup -$mech->delete_user( $user ); -$mech->delete_problems_for_body(1234); done_testing(); + +END { + $mech->delete_user($user); + $mech->delete_user($other_user); +} |