aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller
diff options
context:
space:
mode:
Diffstat (limited to 't/app/controller')
-rw-r--r--t/app/controller/report_updates.t33
1 files changed, 13 insertions, 20 deletions
diff --git a/t/app/controller/report_updates.t b/t/app/controller/report_updates.t
index 5d14a893f..de3ff3a81 100644
--- a/t/app/controller/report_updates.t
+++ b/t/app/controller/report_updates.t
@@ -203,7 +203,7 @@ for my $test (
may_show_name => undef,
},
changes => {},
- field_errors => [ 'Please enter your email', 'Please enter a message' ]
+ field_errors => [ 'Please enter a message', 'Please enter your email' ]
},
{
desc => 'Invalid email, no message',
@@ -217,7 +217,7 @@ for my $test (
may_show_name => undef,
},
changes => {},
- field_errors => [ 'Please enter a valid email', 'Please enter a message' ]
+ field_errors => [ 'Please enter a message', 'Please enter a valid email' ]
},
{
desc => 'email with spaces, no message',
@@ -421,16 +421,15 @@ for my $test (
desc => 'submit update for register user',
initial_values => {
name => 'Test User',
- rznvy => 'test@example.com',
may_show_name => 1,
add_alert => 1,
photo => '',
update => '',
fixed => undef,
},
+ email => 'test@example.com',
fields => {
submit_update => 1,
- rznvy => 'test@example.com',
update => 'update from a registered user',
add_alert => undef,
fixed => undef,
@@ -447,16 +446,15 @@ for my $test (
desc => 'submit update for register user anonymously by unchecking',
initial_values => {
name => 'Test User',
- rznvy => 'test@example.com',
may_show_name => 1,
add_alert => 1,
photo => '',
update => '',
fixed => undef,
},
+ email => 'test@example.com',
fields => {
submit_update => 1,
- rznvy => 'test@example.com',
update => 'update from a registered user',
may_show_name => undef,
add_alert => undef,
@@ -474,17 +472,16 @@ for my $test (
desc => 'submit update for register user anonymously by deleting name',
initial_values => {
name => 'Test User',
- rznvy => 'test@example.com',
may_show_name => 1,
add_alert => 1,
photo => '',
update => '',
fixed => undef,
},
+ email => 'test@example.com',
fields => {
submit_update => 1,
name => '',
- rznvy => 'test@example.com',
update => 'update from a registered user',
may_show_name => 1,
add_alert => undef,
@@ -502,16 +499,15 @@ for my $test (
desc => 'submit update for register user and sign up',
initial_values => {
name => 'Test User',
- rznvy => 'test@example.com',
may_show_name => 1,
add_alert => 1,
photo => '',
update => '',
fixed => undef,
},
+ email => 'test@example.com',
fields => {
submit_update => 1,
- rznvy => 'test@example.com',
update => 'update from a registered user',
add_alert => 1,
fixed => undef,
@@ -528,16 +524,15 @@ for my $test (
desc => 'submit update for register user and mark fixed',
initial_values => {
name => 'Commenter',
- rznvy => 'commenter@example.com',
may_show_name => 1,
add_alert => 1,
photo => '',
update => '',
fixed => undef,
},
+ email => 'commenter@example.com',
fields => {
submit_update => 1,
- rznvy => 'commenter@example.com',
update => 'update from a registered user',
add_alert => undef,
fixed => 1,
@@ -561,7 +556,7 @@ for my $test (
$mech->clear_emails_ok();
- $mech->log_in_ok( $test->{fields}->{rznvy} );
+ $mech->log_in_ok( $test->{email} );
$mech->get_ok("/report/$report_id");
my $values = $mech->visible_form_values( 'updateForm' );
@@ -591,7 +586,7 @@ for my $test (
my $update = $report->comments->first;
ok $update, 'found update';
is $update->text, $results->{update}, 'update text';
- is $update->user->email, $test->{fields}->{rznvy}, 'update user';
+ is $update->user->email, $test->{email}, 'update user';
is $update->state, 'confirmed', 'update confirmed';
is $update->anonymous, $test->{anonymous}, 'user anonymous';
@@ -608,16 +603,15 @@ 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,
},
+ email => 'test@example.com',
fields => {
submit_update => 1,
- rznvy => 'test@example.com',
update => 'update from owner',
add_alert => undef,
fixed => 1,
@@ -637,16 +631,15 @@ foreach my $test (
'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,
},
+ email => 'test@example.com',
fields => {
submit_update => 1,
- rznvy => 'test@example.com',
update => 'update from owner',
add_alert => undef,
fixed => 1,
@@ -693,7 +686,7 @@ foreach my $test (
$mech->clear_emails_ok();
- $mech->log_in_ok( $test->{fields}->{rznvy} );
+ $mech->log_in_ok( $test->{email} );
$mech->get_ok("/report/$report_id");
my $values = $mech->visible_form_values('updateForm');
@@ -717,7 +710,7 @@ foreach my $test (
my $update = $report->comments->first;
ok $update, 'found update';
is $update->text, $results->{update}, 'update text';
- is $update->user->email, $test->{fields}->{rznvy}, 'update user';
+ is $update->user->email, $test->{email}, 'update user';
is $update->state, 'confirmed', 'update confirmed';
is $update->anonymous, $test->{anonymous}, 'user anonymous';