Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

test cache_control without a hash

  • Loading branch information...
commit 48196f690e7794f0a61dd55d64f4a624ea94f557 1 parent 6302295
@rkh rkh authored
Showing with 14 additions and 4 deletions.
  1. +14 −4 test/helpers_test.rb
View
18 test/helpers_test.rb
@@ -507,18 +507,28 @@ def send_file_app(opts={})
describe 'cache_control' do
setup do
- mock_app {
- get '/' do
+ mock_app do
+ get '/foo' do
cache_control :public, :no_cache, :max_age => 60.0
'Hello World'
end
- }
+
+ get '/bar' do
+ cache_control :public, :no_cache
+ 'Hello World'
+ end
+ end
end
it 'sets the Cache-Control header' do
- get '/'
+ get '/foo'
assert_equal ['public', 'no-cache', 'max-age=60'], response['Cache-Control'].split(', ')
end
+
+ it 'last argument does not have to be a hash' do
+ get '/bar'
+ assert_equal ['public', 'no-cache'], response['Cache-Control'].split(', ')
+ end
end
describe 'expires' do
Please sign in to comment.
Something went wrong with that request. Please try again.