History

Fix app cache not updating when changing the app's color theme

This is needed because the index page is part of the app cache, and the <html> tag has a different class depending on the theme.

Thibaut Courouble committed 8 years ago

Commit e8d52c91 parent d72de333 files · +15 −1Browse files

Showing the changes to test (1 of 3 files). Show all

Unified · Split

test/app_test.rb+13−0
@@ -122,6 +122,19 @@ class AppTest < MiniTest::Spec · 121 unmodified lines
122122 refute_includes last_response.body, 'foo'
123123 end
124124
125+ it "has the word 'default' when no 'dark' cookie is set" do
126+ get '/manifest.appcache'
127+ assert_includes last_response.body, '# default'
128+ refute_includes last_response.body, '# dark'
129+ end
130+
131+ it "has the word 'dark' when the cookie is set" do
132+ set_cookie('dark=1')
133+ get '/manifest.appcache'
134+ assert_includes last_response.body, '# dark'
135+ refute_includes last_response.body, '# default'
136+ end
137+
125138 it "sets default size" do
126139 get '/manifest.appcache'
127140 assert_includes last_response.body, '20rem'