-
-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SLWP] Staff must provide email also.
- Loading branch information
Showing
3 changed files
with
32 additions
and
33 deletions.
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
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 |
---|---|---|
|
@@ -1406,40 +1406,34 @@ FixMyStreet::override_config { | |
$echo->mock('GetServiceUnitsForObject', \&garden_waste_one_bin); | ||
|
||
subtest 'check staff renewal' => sub { | ||
foreach ({ email => '[email protected]' }, { phone => '07700900002' }) { | ||
$mech->log_out_ok; | ||
$mech->log_in_ok($staff_user->email); | ||
$mech->get_ok('/waste/12345/garden_renew'); | ||
$mech->submit_form_ok({ with_fields => { | ||
name => 'a user', | ||
%$_, # email or phone, | ||
current_bins => 1, | ||
bins_wanted => 1, | ||
payment_method => 'credit_card', | ||
}}); | ||
$mech->content_contains('20.00'); | ||
|
||
$mech->submit_form_ok({ with_fields => { tandc => 1 } }); | ||
is $call_params->{'scpbase:panEntryMethod'}, 'CNP', 'Correct cardholder-not-present flag'; | ||
is $call_params->{'scpbase:billing'}{'scpbase:cardHolderDetails'}{'scpbase:cardHolderName'}, 'a user', 'Correct name'; | ||
if ($_->{email}) { | ||
is $call_params->{'scpbase:billing'}{'scpbase:cardHolderDetails'}{'scpbase:contact'}{'scpbase:email'}, $_->{email}, 'Correct email'; | ||
} else { | ||
is $call_params->{'scpbase:billing'}{'scpbase:cardHolderDetails'}{'scpbase:contact'}, undef, 'No email section'; | ||
} | ||
is $sent_params->{items}[0]{amount}, 2000, 'correct amount used'; | ||
is $sent_params->{items}[1]{amount}, undef, 'correct amount used'; | ||
$mech->log_out_ok; | ||
$mech->log_in_ok($staff_user->email); | ||
$mech->get_ok('/waste/12345/garden_renew'); | ||
$mech->submit_form_ok({ with_fields => { | ||
name => 'a user', | ||
email => '[email protected]', | ||
current_bins => 1, | ||
bins_wanted => 1, | ||
payment_method => 'credit_card', | ||
}}); | ||
$mech->content_contains('20.00'); | ||
|
||
my ( $token, $report, $report_id ) = get_report_from_redirect( $sent_params->{returnUrl} ); | ||
$mech->submit_form_ok({ with_fields => { tandc => 1 } }); | ||
is $call_params->{'scpbase:panEntryMethod'}, 'CNP', 'Correct cardholder-not-present flag'; | ||
is $call_params->{'scpbase:billing'}{'scpbase:cardHolderDetails'}{'scpbase:cardHolderName'}, 'a user', 'Correct name'; | ||
is $call_params->{'scpbase:billing'}{'scpbase:cardHolderDetails'}{'scpbase:contact'}{'scpbase:email'}, '[email protected]', 'Correct email'; | ||
is $sent_params->{items}[0]{amount}, 2000, 'correct amount used'; | ||
is $sent_params->{items}[1]{amount}, undef, 'correct amount used'; | ||
|
||
check_extra_data_pre_confirm($report, type => 'Renew', new_bins => 0); | ||
my ( $token, $report, $report_id ) = get_report_from_redirect( $sent_params->{returnUrl} ); | ||
|
||
$mech->get_ok("/waste/pay_complete/$report_id/$token"); | ||
is $sent_params->{scpReference}, 12345, 'correct scpReference sent'; | ||
check_extra_data_pre_confirm($report, type => 'Renew', new_bins => 0); | ||
|
||
check_extra_data_post_confirm($report); | ||
$report->delete; # Otherwise next test sees this as latest | ||
} | ||
$mech->get_ok("/waste/pay_complete/$report_id/$token"); | ||
is $sent_params->{scpReference}, 12345, 'correct scpReference sent'; | ||
|
||
check_extra_data_post_confirm($report); | ||
$report->delete; # Otherwise next test sees this as latest | ||
}; | ||
|
||
subtest 'check staff renewal with direct debit' => sub { | ||
|
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 |
---|---|---|
|
@@ -1088,9 +1088,9 @@ FixMyStreet::override_config { | |
$echo->mock('GetServiceUnitsForObject', \&garden_waste_one_bin); | ||
|
||
subtest 'check staff renewal' => sub { | ||
$mech->log_out_ok; | ||
$mech->log_in_ok($staff_user->email); | ||
foreach ({ email => '[email protected]' }, { phone => '07700900002' }) { | ||
$mech->log_out_ok; | ||
$mech->log_in_ok($staff_user->email); | ||
$mech->get_ok('/waste/12345/garden_renew'); | ||
$mech->submit_form_ok({ with_fields => { | ||
name => 'a user', | ||
|
@@ -1099,6 +1099,10 @@ FixMyStreet::override_config { | |
bins_wanted => 1, | ||
payment_method => 'credit_card', | ||
}}); | ||
if (!$_->{email}) { | ||
$mech->content_contains("Please provide an email"); | ||
next; | ||
} | ||
$mech->content_contains('20.00'); | ||
|
||
$mech->submit_form_ok({ with_fields => { tandc => 1 } }); | ||
|