From b632d63f9762dcc07b2e8d66fe44683f809f001c Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Fri, 2 Sep 2011 15:44:59 +0100 Subject: more sensible test for non authority users making forbidden state changes --- t/app/controller/report_updates.t | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 't/app/controller/report_updates.t') diff --git a/t/app/controller/report_updates.t b/t/app/controller/report_updates.t index 993c6758e..b8b91eb6b 100644 --- a/t/app/controller/report_updates.t +++ b/t/app/controller/report_updates.t @@ -413,19 +413,15 @@ subtest 'check non authority user cannot change set state' => sub { $user->update; $mech->get_ok("/report/$report_id"); - $mech->submit_form_ok( { - form_number => 2, - fields => { + $mech->post_ok( "/report/update", { submit_update => 1, id => $report_id, name => $user->name, - rznvy => $user->email, may_show_name => 1, add_alert => 0, photo => '', update => 'this is a forbidden update', state => 'fixed - council', - }, }, 'submitted with state', ); -- cgit v1.2.3 From 6b01e62f553afadc644bdda4c3f460757a20ffef Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Fri, 2 Sep 2011 15:54:37 +0100 Subject: Fix questionnaire test (broke due to being 6 months after fixed date); more fixes to update tests. --- t/app/controller/report_updates.t | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 't/app/controller/report_updates.t') diff --git a/t/app/controller/report_updates.t b/t/app/controller/report_updates.t index b8b91eb6b..4469d4003 100644 --- a/t/app/controller/report_updates.t +++ b/t/app/controller/report_updates.t @@ -418,7 +418,7 @@ subtest 'check non authority user cannot change set state' => sub { id => $report_id, name => $user->name, may_show_name => 1, - add_alert => 0, + add_alert => undef, photo => '', update => 'this is a forbidden update', state => 'fixed - council', @@ -441,19 +441,15 @@ for my $state ( qw/unconfirmed hidden partial/ ) { $user->update; $mech->get_ok("/report/$report_id"); - $mech->submit_form_ok( { - form_number => 2, - fields => { + $mech->post_ok( "/report/update", { submit_update => 1, id => $report_id, name => $user->name, - rznvy => $user->email, may_show_name => 1, - add_alert => 0, + add_alert => undef, photo => '', update => 'this is a forbidden update', state => $state, - }, }, 'submitted with state', ); @@ -473,7 +469,7 @@ for my $test ( fields => { name => $user->name, may_show_name => 1, - add_alert => 0, + add_alert => undef, photo => '', update => 'Set state to investigating', state => 'investigating', @@ -485,7 +481,7 @@ for my $test ( fields => { name => $user->name, may_show_name => 1, - add_alert => 0, + add_alert => undef, photo => '', update => 'Set state to planned', state => 'planned', @@ -497,7 +493,7 @@ for my $test ( fields => { name => $user->name, may_show_name => 1, - add_alert => 0, + add_alert => undef, photo => '', update => 'Set state to in progress', state => 'in progress', @@ -509,7 +505,7 @@ for my $test ( fields => { name => $user->name, may_show_name => 1, - add_alert => 0, + add_alert => undef, photo => '', update => 'Set state to closed', state => 'closed', @@ -521,7 +517,7 @@ for my $test ( fields => { name => $user->name, may_show_name => 1, - add_alert => 0, + add_alert => undef, photo => '', update => 'Set state to fixed', state => 'fixed', @@ -533,7 +529,7 @@ for my $test ( fields => { name => $user->name, may_show_name => 1, - add_alert => 0, + add_alert => undef, photo => '', update => 'Set state to confirmed', state => 'confirmed', @@ -545,7 +541,7 @@ for my $test ( fields => { name => $user->name, may_show_name => 1, - add_alert => 0, + add_alert => undef, photo => '', update => 'Set state to fixed', state => 'fixed', -- cgit v1.2.3