diff options
-rw-r--r-- | .cypress/cypress/integration/buckinghamshire.js | 12 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Buckinghamshire.pm | 2 | ||||
-rw-r--r-- | t/cobrand/bucks.t | 6 |
3 files changed, 16 insertions, 4 deletions
diff --git a/.cypress/cypress/integration/buckinghamshire.js b/.cypress/cypress/integration/buckinghamshire.js index 92426e0d4..1f4641952 100644 --- a/.cypress/cypress/integration/buckinghamshire.js +++ b/.cypress/cypress/integration/buckinghamshire.js @@ -28,6 +28,18 @@ describe('flytipping', function() { cy.wait('@report-ajax'); cy.get('select:eq(4)').select('Flytipping'); cy.contains('sent to Chiltern District Council and also'); + + cy.get('[name=title]').type('Title'); + cy.get('[name=detail]').type('Detail'); + cy.get('.js-new-report-user-show').click(); + cy.get('.js-new-report-show-sign-in').should('be.visible').click(); + cy.get('#form_username_sign_in').type('user@example.org'); + cy.get('[name=password_sign_in]').type('password'); + cy.get('[name=password_sign_in]').parents('form').submit(); + cy.get('#map_sidebar').should('contain', 'check and confirm your details'); + cy.wait('@report-ajax'); + cy.get('#map_sidebar').parents('form').submit(); + cy.get('body').should('contain', 'Thank you for your report'); }); }); diff --git a/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm b/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm index f1dd85176..e210e7d09 100644 --- a/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm +++ b/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm @@ -156,7 +156,7 @@ sub flytipping_body_fix { # If the report is only being sent to the district, we do # not care about the road question, if it is missing if (!$report->to_body_named('Buckinghamshire')) { - delete $errors->{'road-placement'}; + delete $errors->{'xroad-placement'}; } } } diff --git a/t/cobrand/bucks.t b/t/cobrand/bucks.t index a3ae3a196..49900114c 100644 --- a/t/cobrand/bucks.t +++ b/t/cobrand/bucks.t @@ -115,16 +115,16 @@ subtest 'blocked drain sent to extra email' => sub { $cobrand = FixMyStreet::Cobrand::Buckinghamshire->new(); subtest 'Flytipping extra question used if necessary' => sub { - my $errors = { 'road-placement' => 'This field is required' }; + my $errors = { 'xroad-placement' => 'This field is required' }; $report->update({ bodies_str => $body->id }); $cobrand->flytipping_body_fix($report, 'road', $errors); - is $errors->{'road-placement'}, 'This field is required', 'Error stays if sent to county'; + is $errors->{'xroad-placement'}, 'This field is required', 'Error stays if sent to county'; $report->update({ bodies_str => $district->id }); $report->discard_changes; # As e.g. ->bodies has been remembered. $cobrand->flytipping_body_fix($report, 'road', $errors); - is $errors->{'road-placement'}, undef, 'Error removed if sent to district'; + is $errors->{'xroad-placement'}, undef, 'Error removed if sent to district'; $report->update({ bodies_str => $body->id . ',' . $district->id }); $report->discard_changes; # As e.g. ->bodies has been remembered. |