diff --git a/assets/javascripts/views/content/settings_page.coffee b/assets/javascripts/views/content/settings_page.coffee index 1b4ecc1b..e39b17df 100644 --- a/assets/javascripts/views/content/settings_page.coffee +++ b/assets/javascripts/views/content/settings_page.coffee @@ -28,6 +28,7 @@ class app.views.SettingsPage extends app.View html.classList.toggle('_theme-default') html.classList.toggle('_theme-dark') app.settings.set('dark', !!enable) + app.appCache?.updateInBackground() return toggleLayout: (layout, enable) -> diff --git a/test/app_test.rb b/test/app_test.rb index e4c3b583..77975a9d 100644 --- a/test/app_test.rb +++ b/test/app_test.rb @@ -122,6 +122,19 @@ class AppTest < MiniTest::Spec refute_includes last_response.body, 'foo' end + it "has the word 'default' when no 'dark' cookie is set" do + get '/manifest.appcache' + assert_includes last_response.body, '# default' + refute_includes last_response.body, '# dark' + end + + it "has the word 'dark' when the cookie is set" do + set_cookie('dark=1') + get '/manifest.appcache' + assert_includes last_response.body, '# dark' + refute_includes last_response.body, '# default' + end + it "sets default size" do get '/manifest.appcache' assert_includes last_response.body, '20rem' diff --git a/views/manifest.erb b/views/manifest.erb index a95096c6..9d2df923 100644 --- a/views/manifest.erb +++ b/views/manifest.erb @@ -1,5 +1,5 @@ CACHE MANIFEST -# <%= app_size %> <%= app_layout %> +# <%= app_theme %> <%= app_size %> <%= app_layout %> CACHE: /