From 901834444846905c85e56528b020bd1a667cb5d2 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Mon, 11 May 2020 16:56:46 +0100 Subject: Make sure category shown in all its groups. When compiling the reporting category dropdown, only one instance of each value was used. But if a value appears twice, from two different bodies, in different groups, it would then not appear in all the groups it would be expected to. Make sure we update the list of groups of the category if we come across another with the same value. --- t/app/controller/report_new.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 't/app/controller/report_new.t') diff --git a/t/app/controller/report_new.t b/t/app/controller/report_new.t index d2da75f2c..6af709c2c 100644 --- a/t/app/controller/report_new.t +++ b/t/app/controller/report_new.t @@ -641,10 +641,10 @@ subtest "category groups" => sub { } }, sub { $contact2->update( { extra => { group => ['Roads','Pavements'] } } ); - $contact9->update( { extra => { group => 'Roads' } } ); + $contact9->update( { extra => { group => 'Pavements' } } ); $contact10->update( { extra => { group => 'Roads' } } ); $mech->get_ok("/report/new?lat=$saved_lat&lon=$saved_lon"); - $mech->content_like(qr{\s*}); + $mech->content_like(qr{\s*\s*}); $mech->content_like(qr{\s*\s*}); }; }; -- cgit v1.2.3 From 22cc2b0e1e6bb2dd7bde7231ad7f7190737ce545 Mon Sep 17 00:00:00 2001 From: M Somerville Date: Thu, 24 Sep 2020 14:39:59 +0100 Subject: Split up two username fields. Rename the not-logging-in username field to username_register. Keep the sign-in field as username because that e.g. overlaps with auth code in two-factor authentication. --- t/app/controller/report_new.t | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 't/app/controller/report_new.t') diff --git a/t/app/controller/report_new.t b/t/app/controller/report_new.t index 6af709c2c..b0c93c332 100644 --- a/t/app/controller/report_new.t +++ b/t/app/controller/report_new.t @@ -156,7 +156,7 @@ foreach my $test ( photo1 => '', name => 'Joe Bloggs', may_show_name => '1', - username => 'test-1@example.com', + username_register => 'test-1@example.com', phone => '07903 123 456', category => 'Street lighting', password_register => $test->{password} ? 'secret' : '', @@ -680,7 +680,7 @@ subtest "test report creation for a category that is non public" => sub { title => 'Test Report', detail => 'Test report details.', photo1 => '', - username => $user->email, + username_register => $user->email, name => 'Joe Bloggs', category => 'Street lighting', } @@ -940,7 +940,7 @@ for my $test ( title => "Test Report", detail => 'Test report details.', photo1 => '', - username => 'firstlast@example.com', + username_register => 'firstlast@example.com', may_show_name => '1', phone => '07903 123 456', category => 'Trees', @@ -1085,7 +1085,7 @@ subtest "test Hart" => sub { $mech->submit_form_ok( { with_fields => { pc => 'GU51 4AE' } }, "submit location" ); $mech->follow_link_ok( { text_regex => qr/skip this step/i, }, "follow 'skip this step' link" ); my %optional_fields = $test->{confirm} ? () : - ( username => $test_email, phone => '07903 123 456' ); + ( username_register => $test_email, phone => '07903 123 456' ); # we do this as otherwise test::www::mechanize::catalyst # goes to the value set in ->host above irregardless and @@ -1279,7 +1279,7 @@ subtest "extra google analytics code displayed on email confirmation problem cre title => "Test Report", detail => 'Test report details.', photo1 => '', - username => 'firstlast@example.com', + username_register => 'firstlast@example.com', name => 'Test User', may_show_name => '1', phone => '07903 123 456', -- cgit v1.2.3 From 399b8a783a1833098ab8401087d8a6609ac6d515 Mon Sep 17 00:00:00 2001 From: M Somerville Date: Thu, 1 Oct 2020 17:56:29 +0100 Subject: Record whether report made on desktop or mobile. --- t/app/controller/report_new.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't/app/controller/report_new.t') diff --git a/t/app/controller/report_new.t b/t/app/controller/report_new.t index b0c93c332..77eb4fefb 100644 --- a/t/app/controller/report_new.t +++ b/t/app/controller/report_new.t @@ -149,7 +149,7 @@ foreach my $test ( $mech->submit_form_ok( { - button => 'submit_register', + button => 'submit_register_mobile', with_fields => { title => 'Test Report', detail => 'Test report details.', -- cgit v1.2.3