diff options
Diffstat (limited to 't/cobrand')
-rw-r--r-- | t/cobrand/national_assets.t | 30 |
1 files changed, 30 insertions, 0 deletions
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(); |