Class: Test::Unit::TestCase

Inherits:
Object
  • Object
show all
Defined in:
lib/redirect/test.rb

Instance Method Summary collapse

Instance Method Details

#assert_redirects(from, to) ⇒ Object



6
7
8
9
10
# File 'lib/redirect/test.rb', line 6

def assert_redirects(from, to)
  res = Rack::MockRequest.new(APP[:redirect_app]).get(from)
  res.headers.should == { 'Location' => to, 'Content-Type' => 'text/html' }
  res.body.should == "Redirecting to: \#{to}"
end