mirror of
https://github.com/freeCodeCamp/devdocs
synced 2024-11-16 19:48:10 +01:00
Bust AppCache when changing color theme
This commit is contained in:
parent
5882c1d2d5
commit
33b60acd34
2 changed files with 14 additions and 0 deletions
|
@ -57,6 +57,19 @@ class AppTest < MiniTest::Spec
|
|||
assert_includes last_response.body, '/css/index.json'
|
||||
assert_includes last_response.body, '/html/index.json'
|
||||
end
|
||||
|
||||
it "includes has the word 'light' by default" do
|
||||
get '/manifest.appcache'
|
||||
assert_includes last_response.body, '# light'
|
||||
refute_includes last_response.body, '# dark'
|
||||
end
|
||||
|
||||
it "includes 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, '# light'
|
||||
end
|
||||
end
|
||||
|
||||
describe "/[doc]" do
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
CACHE MANIFEST
|
||||
# <%= cookies[:dark].nil? ? 'light' : 'dark' %>
|
||||
|
||||
CACHE:
|
||||
/
|
||||
|
|
Loading…
Reference in a new issue