Skip to content

Commit

Permalink
Support latest rack
Browse files Browse the repository at this point in the history
  • Loading branch information
raggi committed Jan 2, 2011
1 parent d9afe68 commit 7ab7f87
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions test/test_async.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ def em_async_schedule
def app
TestApp.new
end

def assert_redirect(path)
r = last_request.env
uri = r['rack.url_scheme'] + '://' + r['SERVER_NAME'] + path
assert_equal uri, last_response.location
end

def test_basic_async_get
get '/hello'
Expand Down Expand Up @@ -171,21 +177,21 @@ def test_redirect
aget '/redirect'
assert last_response.redirect?
assert_equal 302, last_response.status
assert_equal '/', last_response.location
assert_redirect '/'
end

def test_aredirect
aget '/aredirect'
assert last_response.redirect?
assert_equal 302, last_response.status
assert_equal '/', last_response.location
assert_redirect '/'
end

def test_emredirect
aget '/emredirect'
em_async_continue
assert last_response.redirect?
assert_equal 302, last_response.status
assert_equal '/', last_response.location
assert_redirect '/'
end
end

0 comments on commit 7ab7f87

Please sign in to comment.