@@ -55,6 +55,18 @@ def app
5555 get '/'
5656 assert_includes last_response . body , '<body class="foo">'
5757 end
58+
59+ it "sets the <html> theme from cookie" do
60+ get '/'
61+ assert_match %r{<html [^>]*class="[^\" ]*_theme-default} , last_response . body
62+ refute_includes last_response . body , '_theme-dark'
63+
64+ set_cookie ( 'dark=1' )
65+
66+ get '/'
67+ assert_match %r{<html [^>]*class="[^\" ]*_theme-dark} , last_response . body
68+ refute_includes last_response . body , '_theme-default'
69+ end
5870 end
5971
6072 describe "/[static-page]" do
@@ -110,19 +122,6 @@ def app
110122 refute_includes last_response . body , 'foo'
111123 end
112124
113- it "has the word 'default' when no 'dark' cookie is set" do
114- get '/manifest.appcache'
115- assert_includes last_response . body , '# default'
116- refute_includes last_response . body , '# dark'
117- end
118-
119- it "has the word 'dark' when the cookie is set" do
120- set_cookie ( 'dark=1' )
121- get '/manifest.appcache'
122- assert_includes last_response . body , '# dark'
123- refute_includes last_response . body , '# default'
124- end
125-
126125 it "sets default size" do
127126 get '/manifest.appcache'
128127 assert_includes last_response . body , '20rem'
0 commit comments