aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/report_updates.t
diff options
context:
space:
mode:
Diffstat (limited to 't/app/controller/report_updates.t')
-rw-r--r--t/app/controller/report_updates.t50
1 files changed, 25 insertions, 25 deletions
diff --git a/t/app/controller/report_updates.t b/t/app/controller/report_updates.t
index 0526b2fd7..7cb547081 100644
--- a/t/app/controller/report_updates.t
+++ b/t/app/controller/report_updates.t
@@ -196,7 +196,7 @@ for my $test (
{
desc => 'No email, no message',
fields => {
- rznvy => '',
+ username => '',
update => '',
name => '',
photo1 => '',
@@ -215,7 +215,7 @@ for my $test (
{
desc => 'Invalid email, no message',
fields => {
- rznvy => 'test',
+ username => 'test',
update => '',
name => '',
photo1 => '',
@@ -234,7 +234,7 @@ for my $test (
{
desc => 'email with spaces, no message',
fields => {
- rznvy => 'test @ example. com',
+ username => 'test @ example. com',
update => '',
name => '',
photo1 => '',
@@ -248,14 +248,14 @@ for my $test (
password_sign_in => '',
},
changes => {
- rznvy => 'test@example.com',
+ username => 'test@example.com',
},
field_errors => [ 'Please enter a message', 'Please enter your name' ]
},
{
desc => 'email with uppercase, no message',
fields => {
- rznvy => 'test@EXAMPLE.COM',
+ username => 'test@EXAMPLE.COM',
update => '',
name => '',
photo1 => '',
@@ -269,7 +269,7 @@ for my $test (
password_sign_in => '',
},
changes => {
- rznvy => 'test@example.com',
+ username => 'test@example.com',
},
field_errors => [ 'Please enter a message', 'Please enter your name' ]
},
@@ -297,7 +297,7 @@ for my $test (
desc => 'submit an update for a non registered user',
initial_values => {
name => '',
- rznvy => '',
+ username => '',
may_show_name => 1,
add_alert => 1,
photo1 => '',
@@ -311,7 +311,7 @@ for my $test (
},
form_values => {
submit_update => 1,
- rznvy => 'unregistered@example.com',
+ username => 'unregistered@example.com',
update => 'Update from an unregistered user',
add_alert => undef,
name => 'Unreg User',
@@ -323,7 +323,7 @@ for my $test (
desc => 'submit an update for a non registered user and sign up',
initial_values => {
name => '',
- rznvy => '',
+ username => '',
may_show_name => 1,
add_alert => 1,
photo1 => '',
@@ -337,7 +337,7 @@ for my $test (
},
form_values => {
submit_update => 1,
- rznvy => 'unregistered@example.com',
+ username => 'unregistered@example.com',
update => "update from an\r\n\r\nunregistered user",
add_alert => 1,
name => 'Unreg User',
@@ -395,14 +395,14 @@ for my $test (
ok $update, 'found update in database';
is $update->state, 'unconfirmed', 'update unconfirmed';
- is $update->user->email, $details->{rznvy}, 'update email';
+ is $update->user->email, $details->{username}, 'update email';
is $update->text, $details->{update}, 'update text';
is $add_alerts, $details->{add_alert} ? 1 : 0, 'do not sign up for alerts';
$mech->get_ok( $url );
$mech->content_contains("/report/$report_id#update_$update_id");
- my $unreg_user = FixMyStreet::App->model( 'DB::User' )->find( { email => $details->{rznvy} } );
+ my $unreg_user = FixMyStreet::App->model( 'DB::User' )->find( { email => $details->{username} } );
ok $unreg_user, 'found user';
@@ -427,7 +427,7 @@ for my $test (
desc => 'overriding email confirmation allows report confirmation with no email sent',
initial_values => {
name => '',
- rznvy => '',
+ username => '',
may_show_name => 1,
add_alert => 1,
photo1 => '',
@@ -441,7 +441,7 @@ for my $test (
},
form_values => {
submit_update => 1,
- rznvy => 'unregistered@example.com',
+ username => 'unregistered@example.com',
update => "update no email confirm",
add_alert => 1,
name => 'Unreg User',
@@ -493,10 +493,10 @@ for my $test (
ok $update, 'found update in database';
is $update->state, 'confirmed', 'update confirmed';
- is $update->user->email, $details->{rznvy}, 'update email';
+ is $update->user->email, $details->{username}, 'update email';
is $update->text, $details->{update}, 'update text';
- my $unreg_user = FixMyStreet::App->model( 'DB::User' )->find( { email => $details->{rznvy} } );
+ my $unreg_user = FixMyStreet::App->model( 'DB::User' )->find( { email => $details->{username} } );
ok $unreg_user, 'found user';
@@ -972,13 +972,13 @@ for my $test (
desc => 'submit an update for a registered user, signing in with wrong password',
form_values => {
submit_update => 1,
- rznvy => 'registered@example.com',
+ username => 'registered@example.com',
update => 'Update from a user',
add_alert => undef,
password_sign_in => 'secret',
},
field_errors => [
- "There was a problem with your email/password combination. If you cannot remember your password, or do not have one, please fill in the \x{2018}sign in by email\x{2019} section of the form.",
+ "There was a problem with your login information. If you cannot remember your password, or do not have one, please fill in the \x{2018}No\x{2019} section of the form.",
'Please enter your name', # FIXME Not really necessary error
],
},
@@ -986,7 +986,7 @@ for my $test (
desc => 'submit an update for a registered user and sign in',
form_values => {
submit_update => 1,
- rznvy => 'registered@example.com',
+ username => 'registered@example.com',
update => 'Update from a user',
add_alert => undef,
password_sign_in => 'secret2',
@@ -996,7 +996,7 @@ for my $test (
) {
subtest $test->{desc} => sub {
# Set things up
- my $user = $mech->create_user_ok( $test->{form_values}->{rznvy} );
+ my $user = $mech->create_user_ok( $test->{form_values}->{username} );
my $pw = 'secret2';
$user->update( { name => 'Mr Reg', password => $pw } );
$report->comments->delete;
@@ -1036,7 +1036,7 @@ for my $test (
my $update = $report->comments->first;
ok $update, 'found update';
is $update->text, $test->{form_values}->{update}, 'update text';
- is $update->user->email, $test->{form_values}->{rznvy}, 'update user';
+ is $update->user->email, $test->{form_values}->{username}, 'update user';
is $update->state, 'confirmed', 'update confirmed';
$mech->delete_user( $update->user );
}
@@ -1053,7 +1053,7 @@ subtest 'submit an update for a registered user, creating update by email' => su
$mech->submit_form_ok( {
with_fields => {
submit_update => 1,
- rznvy => 'registered@example.com',
+ username => 'registered@example.com',
update => 'Update from a user',
add_alert => undef,
name => 'New Name',
@@ -1502,7 +1502,7 @@ for my $test (
fields => {
submit_update => 1,
name => 'Test User',
- rznvy => 'test@example.com',
+ username => 'test@example.com',
may_show_name => 1,
update => 'update from owner',
add_alert => undef,
@@ -1524,7 +1524,7 @@ for my $test (
submit_update => 1,
name => 'Test User',
may_show_name => 1,
- rznvy => 'test@example.com',
+ username => 'test@example.com',
update => 'update from owner',
add_alert => undef,
fixed => 1,
@@ -1589,7 +1589,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->{fields}->{username}, 'update user';
is $update->state, 'unconfirmed', 'update confirmed';
is $update->anonymous, $test->{anonymous}, 'user anonymous';