Permalink
Browse files

Merge pull request #519 from mattwildig/missing-tests

Missing tests
  • Loading branch information...
2 parents f948c23 + 1c262be commit 40e967bca2553def4329d1a88cbfe3473a85b722 @rkh rkh committed May 29, 2012
Showing with 9 additions and 9 deletions.
  1. +1 −1 test/delegator_test.rb
  2. +3 −3 test/filter_test.rb
  3. +5 −5 test/helpers_test.rb
@@ -100,7 +100,7 @@ def target
assert_equal ["helpers", mixin.to_s], app.last_call
end
- it "registers helpers with the delegation target" do
+ it "registers middleware with the delegation target" do
app, mixin = mirror, Module.new
Sinatra.use mixin
assert_equal ["use", mixin.to_s], app.last_call
View
@@ -156,11 +156,11 @@ class BeforeFilterTest < Test::Unit::TestCase
end
class AfterFilterTest < Test::Unit::TestCase
- it "executes filters in the order defined" do
+ it "executes before and after filters in correct order" do
invoked = 0
mock_app do
before { invoked = 2 }
- get('/') { invoked += 2 }
+ get('/') { invoked += 2; 'hello' }
after { invoked *= 2 }
end
@@ -410,7 +410,7 @@ class AfterFilterTest < Test::Unit::TestCase
assert ran
end
- it 'is possible to apply user_agent conditions to before filters with a path' do
+ it 'is possible to apply user_agent conditions to after filters with a path' do
ran = false
mock_app do
after('/foo', :user_agent => /foo/) { ran = true }
View
@@ -31,12 +31,12 @@ def status_app(code, &block)
assert_body 'true'
end
- it 'is false for status > 404' do
+ it 'is false for status gt 404' do
status_app(405) { not_found? }
assert_body 'false'
end
- it 'is false for status < 404' do
+ it 'is false for status lt 404' do
status_app(403) { not_found? }
assert_body 'false'
end
@@ -601,7 +601,7 @@ def attachment_app(filename=nil)
assert_equal '<sinatra></sinatra>', body
end
- it 'sets the Content-Type response header without extname' do
+ it 'sets the Content-Type response header with extname' do
mock_app do
get('/attachment') do
content_type :atom
@@ -812,12 +812,12 @@ def obj.is_a?(thing) 60.is_a?(thing) end
assert_not_nil response['Expires']
end
- it 'allows passing time objects' do
+ it 'allows passing Time.now objects' do
get '/bar'
assert_not_nil response['Expires']
end
- it 'allows passing time objects' do
+ it 'allows passing Time.at objects' do
get '/baz'
assert_equal 'Thu, 01 Jan 1970 00:00:00 GMT', response['Expires']
end

0 comments on commit 40e967b

Please sign in to comment.