aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/app/controller/report_new.t7
-rw-r--r--t/cobrand/national_assets.t30
-rw-r--r--t/map/tests.t8
3 files changed, 41 insertions, 4 deletions
diff --git a/t/app/controller/report_new.t b/t/app/controller/report_new.t
index 8c4deec56..048f2644e 100644
--- a/t/app/controller/report_new.t
+++ b/t/app/controller/report_new.t
@@ -967,6 +967,13 @@ foreach my $test (
extra_fields => { single_body_only => 'Invalid council' },
email_count => 1,
},
+ {
+ desc => "test do_not_send means body is ignored",
+ category => 'Street lighting',
+ councils => [ 2326 ],
+ extra_fields => { do_not_send => 'Gloucestershire County Council' },
+ email_count => 1,
+ },
) {
subtest $test->{desc} => sub {
diff --git a/t/cobrand/national_assets.t b/t/cobrand/national_assets.t
new file mode 100644
index 000000000..378425193
--- /dev/null
+++ b/t/cobrand/national_assets.t
@@ -0,0 +1,30 @@
+use FixMyStreet::TestMech;
+my $mech = FixMyStreet::TestMech->new;
+
+# Create test data
+my $body = $mech->create_body_ok( 2561, 'Bristol County Council' );
+
+
+subtest 'cobrand assets includes cobrand assets javascript', sub {
+ FixMyStreet::override_config {
+ ALLOWED_COBRANDS => [ 'fixmystreet' ],
+ MAPIT_URL => 'http://mapit.uk/',
+ }, sub {
+ $mech->get_ok("/report/new?latitude=51.494885&longitude=-2.602237");
+ $mech->content_contains('buckinghamshire/assets.js');
+ };
+};
+
+subtest 'cobrand assets includes not applied on cobrand sites', sub {
+ FixMyStreet::override_config {
+ ALLOWED_COBRANDS => [ 'bathnes' ],
+ MAPIT_URL => 'http://mapit.uk/',
+ MAP_TYPE => 'FMS,OSM,BathNES,Buckinghamshire',
+ }, sub {
+ $mech->get_ok("/report/new?latitude=51.494885&longitude=-2.602237");
+ $mech->content_lacks('buckinghamshire/assets.js');
+ $mech->content_contains('bathnes/assets.js');
+ };
+};
+
+done_testing();
diff --git a/t/map/tests.t b/t/map/tests.t
index e6749b813..5575eafbb 100644
--- a/t/map/tests.t
+++ b/t/map/tests.t
@@ -3,11 +3,11 @@ use Test::More;
my $requires = {
'Angus' => 'angus/js.js',
- 'BathNES' => 'bathnes/js.js',
+ 'BathNES' => 'bathnes/assets.js',
'Bing' => 'map-bing-ol.js',
- 'Bristol' => 'bristol/js.js',
- 'Bromley' => 'bromley/map.js',
- 'Buckinghamshire' => 'buckinghamshire/js.js',
+ 'Bristol' => 'bristol/assets.js',
+ 'Bromley' => 'bromley/assets.js',
+ 'Buckinghamshire' => 'buckinghamshire/assets.js',
'FMS' => 'map-fms.js',
'Google' => 'map-google.js',
'GoogleOL' => 'map-google-ol.js',