Skip to content

Commit

Permalink
Testcase for GH rails#5114.
Browse files Browse the repository at this point in the history
  • Loading branch information
kennyj committed Feb 21, 2012
1 parent 67a5157 commit f5e69fc
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions actionpack/test/dispatch/routing_test.rb
Expand Up @@ -2402,3 +2402,29 @@ def app; Routes end


end end


class TestTildeAndMinusPaths < ActionDispatch::IntegrationTest
Routes = ActionDispatch::Routing::RouteSet.new.tap do |app|
app.draw do
match "/~user" => lambda { |env|
[200, { 'Content-Type' => 'text/plain' }, []]
}, :as => :tilde_path
match "/young-and-fine" => lambda { |env|
[200, { 'Content-Type' => 'text/plain' }, []]
}, :as => :tilde_path
end
end

include Routes.url_helpers
def app; Routes end

test 'recognizes tilde path' do
get "/~user"
assert_equal "200", @response.code
end

test 'recognizes minus path' do
get "/young-and-fine"
assert_equal "200", @response.code
end

end

0 comments on commit f5e69fc

Please sign in to comment.