diff options
Diffstat (limited to 't/app/controller/report_new.t')
-rw-r--r-- | t/app/controller/report_new.t | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/t/app/controller/report_new.t b/t/app/controller/report_new.t index ff4f4294f..15237e041 100644 --- a/t/app/controller/report_new.t +++ b/t/app/controller/report_new.t @@ -2,6 +2,7 @@ use strict; use utf8; # sign in error message has – in it use warnings; use Test::More; +use utf8; use FixMyStreet::TestMech; use Web::Scraper; @@ -375,9 +376,11 @@ foreach my $test ( FixMyStreet::App->model('DB::User')->find( { email => $test_email } ); ok $user, "user found"; if ($test->{user}) { + is $user->name, 'Old Name', 'name unchanged'; ok $user->check_password('old_password'), 'password unchanged'; } else { - ok $user->check_password('secret'), 'password set correctly'; + is $user->name, undef, 'name not yet set'; + is $user->password, '', 'password not yet set for new user'; } # find the report @@ -406,10 +409,8 @@ foreach my $test ( $mech->get_ok( '/report/' . $report->id ); - if ($test->{user}) { - is $report->name, 'Joe Bloggs', 'name updated correctly'; - ok $report->user->check_password('secret'), 'password updated correctly'; - } + is $report->name, 'Joe Bloggs', 'name updated correctly'; + ok $report->user->check_password('secret'), 'password updated correctly'; # check that the reporter has an alert my $alert = FixMyStreet::App->model('DB::Alert')->find( { @@ -615,7 +616,7 @@ foreach my $test ( $mech->submit_form_ok( { with_fields => { - title => "Test Report at caf\xc3\xa9", + title => "Test Report at cafĂ©", detail => 'Test report details.', photo => '', name => 'Joe Bloggs', @@ -670,7 +671,7 @@ foreach my $test ( } -$contact2->category( "Pothol\xe9s" ); +$contact2->category( "Pothol\xc3\xa9s" ); $contact2->update; $mech->get_ok( '/report/new/ajax?latitude=' . $saved_lat . '&longitude=' . $saved_lon ); $mech->content_contains( "Pothol\xc3\xa9s" ); |