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)
  assert_equal to,          res.headers['Location'    ]
  assert_equal 'text/html', res.headers['Content-Type']
end