-
-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! [Northumberland] Add comment when assigned user or extra detai…
…ls updated
- Loading branch information
1 parent
f5f7831
commit 818dabf
Showing
1 changed file
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
use CGI::Simple; | ||
use FixMyStreet::TestMech; | ||
use FixMyStreet::Script::CSVExport; | ||
use Test::MockModule; | ||
|
@@ -115,6 +116,8 @@ FixMyStreet::override_config { | |
ALLOWED_COBRANDS => [ 'northumberland', 'fixmystreet' ], | ||
MAPIT_URL => 'http://mapit.uk/', | ||
}, sub { | ||
my $o = Open311->new( fixmystreet_body => $body ); | ||
|
||
my $superuser = $mech->create_user_ok( | ||
'[email protected]', | ||
name => 'Super User', | ||
|
@@ -142,6 +145,15 @@ FixMyStreet::override_config { | |
is_superuser => 1, | ||
}, 'Comment created for user assignment'; | ||
|
||
my $id = $o->post_service_request_update($comment); | ||
my $cgi = CGI::Simple->new($o->test_req_used->content); | ||
is $cgi->param('attribute[assigned_to_user_email]'), | ||
$superuser->email, | ||
'correct assigned_to_user_email attribute'; | ||
is $cgi->param('attribute[extra_details]'), | ||
'', | ||
'correct extra_details attribute'; | ||
|
||
$mech->get_ok( '/report/' . $problem_to_update->id ); | ||
$mech->click_ok('.btn--shortlisted'); | ||
$comment | ||
|
@@ -150,6 +162,15 @@ FixMyStreet::override_config { | |
shortlisted_user => undef, | ||
is_superuser => 1, | ||
}, 'Comment created for user un-assignment'; | ||
|
||
$id = $o->post_service_request_update($comment); | ||
$cgi = CGI::Simple->new($o->test_req_used->content); | ||
is $cgi->param('attribute[assigned_to_user_email]'), | ||
'', | ||
'correct assigned_to_user_email attribute'; | ||
is $cgi->param('attribute[extra_details]'), | ||
'', | ||
'correct extra_details attribute'; | ||
}; | ||
|
||
subtest "Extra details on $host site" => sub { | ||
|
@@ -158,7 +179,7 @@ FixMyStreet::override_config { | |
button => 'save', | ||
form_id => 'report_inspect_form', | ||
fields => { | ||
detailed_information => 'A', | ||
detailed_information => 'ABC', | ||
include_update => 0, | ||
}, | ||
); | ||
|
@@ -169,6 +190,15 @@ FixMyStreet::override_config { | |
is_superuser => 1, | ||
}, 'Comment created for extra details'; | ||
|
||
my $id = $o->post_service_request_update($comment); | ||
my $cgi = CGI::Simple->new($o->test_req_used->content); | ||
is $cgi->param('attribute[assigned_to_user_email]'), | ||
'', | ||
'correct assigned_to_user_email attribute'; | ||
is $cgi->param('attribute[extra_details]'), | ||
'ABC', | ||
'correct extra_details attribute'; | ||
|
||
$mech->get_ok( '/report/' . $problem_to_update->id ); | ||
$mech->submit_form( | ||
button => 'save', | ||
|
@@ -187,6 +217,15 @@ FixMyStreet::override_config { | |
is_deeply $problem_to_update->get_extra_metadata, | ||
{}, | ||
'Extra details unset on problem'; | ||
|
||
$id = $o->post_service_request_update($comment); | ||
$cgi = CGI::Simple->new($o->test_req_used->content); | ||
is $cgi->param('attribute[assigned_to_user_email]'), | ||
'', | ||
'correct assigned_to_user_email attribute'; | ||
is $cgi->param('attribute[extra_details]'), | ||
'', | ||
'correct extra_details attribute'; | ||
}; | ||
} | ||
}; | ||
|