From 3231c65a0a653695b726fb5a36b9ab7d9cf3a137 Mon Sep 17 00:00:00 2001 From: Dave Arter Date: Fri, 31 Jan 2020 18:29:59 +0000 Subject: Use ManifestTheme theme_colour for front page theme-color meta tag --- t/app/controller/admin/manifesttheme.t | 8 ++++---- t/app/controller/offline.t | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 't/app/controller') diff --git a/t/app/controller/admin/manifesttheme.t b/t/app/controller/admin/manifesttheme.t index 9a86bdeb7..c1b2d4542 100644 --- a/t/app/controller/admin/manifesttheme.t +++ b/t/app/controller/admin/manifesttheme.t @@ -114,8 +114,8 @@ subtest "cobrand admin lets you add an icon to an existing theme" => sub { ok $mech->success, 'Posted request successfully'; is $mech->uri->path, '/admin/manifesttheme/lincolnshire', "redirected back to edit page"; - $mech->content_contains($icon_filename); - $mech->content_contains("133x100"); + $mech->content_contains("content_contains("133x100"); my $icon_dest = path(FixMyStreet->path_to('web/theme/lincolnshire/', $icon_filename)); ok $icon_dest->exists, "Icon stored on disk"; }; @@ -132,8 +132,8 @@ subtest "cobrand admin lets you delete an icon from an existing theme" => sub { $mech->submit_form_ok( { with_fields => $fields } ); is $mech->uri->path, '/admin/manifesttheme/lincolnshire', "redirected back to edit page"; - $mech->content_lacks($icon_filename); - $mech->content_lacks("133x100"); + $mech->content_lacks("content_lacks("133x100"); ok !$icon_dest->exists, "Icon removed from disk"; }; diff --git a/t/app/controller/offline.t b/t/app/controller/offline.t index a3feae514..876475264 100644 --- a/t/app/controller/offline.t +++ b/t/app/controller/offline.t @@ -1,6 +1,7 @@ use FixMyStreet::TestMech; use FixMyStreet::DB; use Path::Tiny; +use Memcached; my $mech = FixMyStreet::TestMech->new; @@ -12,6 +13,7 @@ FixMyStreet::override_config { my $image_path = path('t/app/controller/sample.jpg'); $image_path->copy($theme_dir->child('sample.jpg')); subtest 'manifest' => sub { + Memcached::delete("manifest_theme:test"); my $j = $mech->get_ok_json('/.well-known/manifest.webmanifest'); is $j->{name}, 'FixMyStreet', 'correct name'; is $j->{theme_color}, '#ffd000', 'correct theme colour'; @@ -22,6 +24,7 @@ FixMyStreet::override_config { }, 'correct icon'; }; subtest 'themed manifest' => sub { + Memcached::delete("manifest_theme:test"); FixMyStreet::DB->resultset('ManifestTheme')->create({ cobrand => "test", name => "My Test Cobrand FMS", -- cgit v1.2.3