Merge pull request #17234 from arthurnn/add_regression_for_path_and_cascade

Add regression test for router was overwriting PATH_INFO
This commit is contained in:
Rafael Mendonça França 2014-10-13 10:08:18 -03:00
commit c0c5f30d41
1 changed files with 8 additions and 0 deletions

View File

@ -615,6 +615,8 @@ class ApplicationIntegrationTest < ActionDispatch::IntegrationTest
get 'bar', :to => 'application_integration_test/test#index', :as => :bar
mount MountedApp => '/mounted', :as => "mounted"
get 'fooz' => proc { |env| [ 200, {'X-Cascade' => 'pass'}, [ "omg" ] ] }, :anchor => false
get 'fooz', :to => 'application_integration_test/test#index'
end
def app
@ -631,6 +633,12 @@ class ApplicationIntegrationTest < ActionDispatch::IntegrationTest
assert_equal '/mounted/baz', mounted.baz_path
end
test "path after cascade pass" do
get '/fooz'
assert_equal 'index', response.body
assert_equal '/fooz', path
end
test "route helpers after controller access" do
get '/'
assert_equal '/', empty_string_path