public
Description: The invisible framework
Homepage: http://macournoyer.com/
Clone URL: git://github.com/macournoyer/invisible.git
invisible / spec / redirect_spec.rb
100644 19 lines (16 sloc) 0.423 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
require File.dirname(__FILE__) + "/spec_helper"
 
describe "redirect" do
  before do
    @app = Invisible.new do
      get "/redirect" do
        redirect_to "/"
      end
    end
  end
  
  it "should redirect to path" do
    response = @app.mock.get("/redirect")
    response.status.should == 302
    response.location.should == "/"
    response.body.should == "<p>You are redirected to <a href=\"/\">/</a></p>"
  end
end