Showing the changes to test (1 of 2 files). Show all
Unified · Split
| @@ -43,35 +43,6 @@ class AppTest < MiniTest::Spec · 42 unmodified lines | |||
| 43 | assert last_response.redirect? | 43 | assert last_response.redirect? |
| 44 | assert_equal 'https://example.org/', last_response['Location'] | 44 | assert_equal 'https://example.org/', last_response['Location'] |
| 45 | end | 45 | end |
| 46 | |||
| 47 | it "sets default size" do | ||
| 48 | get '/' | ||
| 49 | assert_includes last_response.body, 'data-size="20rem"' | ||
| 50 | end | ||
| 51 | |||
| 52 | it "sets size from cookie" do | ||
| 53 | set_cookie('size=42') | ||
| 54 | get '/' | ||
| 55 | assert_includes last_response.body, 'data-size="42px"' | ||
| 56 | end | ||
| 57 | |||
| 58 | it "sets layout from cookie" do | ||
| 59 | set_cookie('layout=foo') | ||
| 60 | get '/' | ||
| 61 | assert_includes last_response.body, '<body class="foo">' | ||
| 62 | end | ||
| 63 | |||
| 64 | it "sets the <html> theme from cookie" do | ||
| 65 | get '/' | ||
| 66 | assert_match %r{<html [^>]*class="[^\"]*_theme-default}, last_response.body | ||
| 67 | refute_includes last_response.body, '_theme-dark' | ||
| 68 | |||
| 69 | set_cookie('dark=1') | ||
| 70 | |||
| 71 | get '/' | ||
| 72 | assert_match %r{<html [^>]*class="[^\"]*_theme-dark}, last_response.body | ||
| 73 | refute_includes last_response.body, '_theme-default' | ||
| 74 | end | ||
| 75 | end | 46 | end |
| 76 | 47 | ||
| 77 | describe "/[static-page]" do | 48 | describe "/[static-page]" do |