Fixes #424.
Unified · Split
| @@ -119,7 +119,7 @@ class App < Sinatra::Application · 118 unmodified lines | |||
| 119 | @docs ||= begin | 119 | @docs ||= begin |
| 120 | cookie = cookies[:docs] | 120 | cookie = cookies[:docs] |
| 121 | 121 | ||
| 122 | if cookie.nil? || cookie.empty? | 122 | if cookie.nil? |
| 123 | settings.default_docs | 123 | settings.default_docs |
| 124 | else | 124 | else |
| 125 | cookie.split('/') | 125 | cookie.split('/') |
| @@ -132,6 +132,12 @@ class AppTest < MiniTest::Spec · 131 unmodified lines | |||
| 132 | assert last_response.ok? | 132 | assert last_response.ok? |
| 133 | end | 133 | end |
| 134 | 134 | ||
| 135 | it "renders when the doc exists, is a default doc, and all docs are enabled" do | ||
| 136 | set_cookie('docs=') | ||
| 137 | get '/css/', {}, 'HTTP_USER_AGENT' => MODERN_BROWSER | ||
| 138 | assert last_response.ok? | ||
| 139 | end | ||
| 140 | |||
| 135 | it "redirects via JS cookie when the doc exists and is enabled" do | 141 | it "redirects via JS cookie when the doc exists and is enabled" do |
| 136 | set_cookie('docs=html~5') | 142 | set_cookie('docs=html~5') |
| 137 | get '/html~5/', {}, 'HTTP_USER_AGENT' => MODERN_BROWSER | 143 | get '/html~5/', {}, 'HTTP_USER_AGENT' => MODERN_BROWSER |