Created
January 17, 2011 04:27
-
-
Save jc00ke/782488 to your computer and use it in GitHub Desktop.
Use Rack::Builder.parse_file to test your config.ru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'minitest/autorun' | |
require 'minitest/spec' | |
require 'rack/test' | |
describe "config.ru" do | |
include Rack::Test::Methods | |
def app | |
# parse_file returns an array, but we need a rack app | |
Rack::Builder.parse_file('path/to/your/config.ru').first | |
end | |
it "should have redirects" do | |
get "/old" | |
follow_redirects! | |
last_request.path.must_equal "/new" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment