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