diff options
author | Struan Donald <struan@exo.org.uk> | 2011-05-25 16:58:31 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-05-25 16:58:31 +0100 |
commit | bbe4d5975fddfc731b0177119bf4cda401d41d97 (patch) | |
tree | a130c1fa30a068793760e876b7a0a77cbc395a5c /t/app/controller | |
parent | d974cc0258d26a366262bce7b456d39b0c71a40b (diff) |
check that flow is the same regardless of whether user is logged in
Diffstat (limited to 't/app/controller')
-rw-r--r-- | t/app/controller/report_updates.t | 63 |
1 files changed, 62 insertions, 1 deletions
diff --git a/t/app/controller/report_updates.t b/t/app/controller/report_updates.t index 1836423ba..89ce9b6ae 100644 --- a/t/app/controller/report_updates.t +++ b/t/app/controller/report_updates.t @@ -524,6 +524,62 @@ for my $test ( foreach my $test ( { + desc => 'logged in reporter submits update and marks problem fixed', + initial_values => { + name => 'Test User', + rznvy => 'test@example.com', + may_show_name => 1, + add_alert => 1, + photo => '', + update => '', + fixed => undef, + }, + fields => { + submit_update => 1, + rznvy => 'test@example.com', + update => 'update from owner', + add_alert => 0, + fixed => 1, + }, + changed => { update => 'Update from owner' }, + initial_banner => '', + alert => 1, # we signed up for alerts before, do not unsign us + anonymous => 0, + answered => 0, + login => 1, + path => '/report/update', + content => +"Thanks, glad to hear it's been fixed! Could we just ask if you have ever reported a problem to a council before?", + }, + { + desc => +'logged in reporter submits update and marks problem fixed and has answered questionnaire', + initial_values => { + name => 'Test User', + rznvy => 'test@example.com', + may_show_name => 1, + add_alert => 1, + photo => '', + update => '', + fixed => undef, + }, + fields => { + submit_update => 1, + rznvy => 'test@example.com', + update => 'update from owner', + add_alert => 0, + fixed => 1, + }, + changed => { update => 'Update from owner' }, + initial_banner => '', + alert => 1, # we signed up for alerts before, do not unsign us + anonymous => 0, + answered => 1, + login => 1, + path => '/report/' . $report->id, + content => $report->title, + }, + { desc => 'reporter submits update and marks problem fixed', initial_values => { name => 'Test User', @@ -546,6 +602,7 @@ foreach my $test ( alert => 1, # we signed up for alerts before, do not unsign us anonymous => 0, answered => 0, + login => 0, path => '/report/update', content => "Thanks, glad to hear it's been fixed! Could we just ask if you have ever reported a problem to a council before?", @@ -574,6 +631,7 @@ foreach my $test ( alert => 1, # we signed up for alerts before, do not unsign us anonymous => 0, answered => 1, + login => 0, path => '/report/' . $report->id, content => $report->title, }, @@ -607,7 +665,10 @@ foreach my $test ( $mech->clear_emails_ok(); - $mech->log_in_ok( $test->{fields}->{rznvy} ); + SKIP: { + skip 'not logging user in', 1 unless $test->{login}; + $mech->log_in_ok( $test->{fields}->{rznvy} ); + }; $mech->get_ok("/report/$report_id"); my $values = $mech->visible_form_values('updateForm'); |