diff options
author | Struan Donald <struan@exo.org.uk> | 2011-06-23 15:46:55 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-06-23 15:46:55 +0100 |
commit | 159fa8ad9e2427d8b20586baec4c260a0c71b57c (patch) | |
tree | 6feaba3a6fc6e83c86d79f5ed29f13cee114eb6d /t/app | |
parent | 9d8c7de9057bbc721525907de8f0cd4c44d91cce (diff) |
update problem status from update
Diffstat (limited to 't/app')
-rw-r--r-- | t/app/controller/report_updates.t | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/t/app/controller/report_updates.t b/t/app/controller/report_updates.t index de3ff3a81..0812ddd81 100644 --- a/t/app/controller/report_updates.t +++ b/t/app/controller/report_updates.t @@ -418,6 +418,52 @@ subtest 'check non authority user cannot change set state' => sub { for my $test ( { + desc => 'from authority user marks report as fixed', + fields => { + name => $user->name, + may_show_name => 1, + add_alert => 0, + photo => '', + update => 'Set state to fixed', + state => 'fixed', + }, + state => 'fixed - council', + }, +) { + subtest $test->{desc} => sub { + $report->comments->delete; + + $mech->log_in_ok( $user->email ); + $user->from_authority( 1 ); + $user->update; + + $mech->get_ok("/report/$report_id"); + + $mech->submit_form_ok( + { + with_fields => $test->{fields}, + }, + 'submit update' + ); + + my $update = $report->comments->first; + ok $update, 'found update'; + is $update->text, $test->{fields}->{update}, 'update text'; + is $update->problem_state, $test->{state}, 'problem state set'; + + $report->discard_changes; + is $report->state, $test->{state}, 'state set'; + }; +} + +$user->from_authority(0); +$user->update; + +$report->state('confirmed'); +$report->update; + +for my $test ( + { desc => 'submit update for register user', initial_values => { name => 'Test User', |