diff options
Diffstat (limited to 't')
-rw-r--r-- | t/app/controller/report_new_open311.t | 2 | ||||
-rw-r--r-- | t/cobrand/isleofwight.t | 27 |
2 files changed, 28 insertions, 1 deletions
diff --git a/t/app/controller/report_new_open311.t b/t/app/controller/report_new_open311.t index 52f1ddc6e..a0d122a7b 100644 --- a/t/app/controller/report_new_open311.t +++ b/t/app/controller/report_new_open311.t @@ -203,6 +203,8 @@ foreach my $test ( # check that we got the errors expected is_deeply $mech->page_errors, $test->{errors}, "check errors"; + $mech->content_contains('Help <strong>Borsetshire Council</strong> resolve your problem quicker'); + # check that fields have changed as expected my $new_values = { %{ $test->{fields} }, # values added to form diff --git a/t/cobrand/isleofwight.t b/t/cobrand/isleofwight.t index 745b378dc..8afc2f29b 100644 --- a/t/cobrand/isleofwight.t +++ b/t/cobrand/isleofwight.t @@ -16,7 +16,7 @@ my $params = { jurisdiction => 'home', }; my $isleofwight = $mech->create_body_ok(2636, 'Isle of Wight Council', $params); -$mech->create_contact_ok( +my $contact = $mech->create_contact_ok( body_id => $isleofwight->id, category => 'Potholes', email => 'pothole@example.org', @@ -240,4 +240,29 @@ subtest "sends branded report sent emails" => sub { like $mech->get_text_body_from_email($email), qr/Island Roads/, "emails are branded"; }; +subtest "check category extra uses correct name" => sub { + my @extras = ( { + code => 'test', + datatype => 'string', + description => 'question', + variable => 'true', + required => 'false', + order => 1, + datatype_description => 'datatype', + } ); + $contact->set_extra_fields( @extras ); + $contact->update; + + my $extra_details; + + FixMyStreet::override_config { + MAPIT_URL => 'http://mapit.uk/', + ALLOWED_COBRANDS => ['isleofwight','fixmystreet'], + }, sub { + $extra_details = $mech->get_ok_json('/report/new/category_extras?category=Potholes&latitude=50.71086&longitude=-1.29573'); + }; + + like $extra_details->{category_extra}, qr/Island Roads/, 'correct name in category extras'; +}; + done_testing(); |