Permalink
Browse files

Add test case for #1366

  • Loading branch information...
namusyaka committed Aug 6, 2013
1 parent 4bf5202 commit 14e2e3c2242218e6c7c8619c2f0f5e04baacb5e5
Showing with 14 additions and 0 deletions.
  1. +14 −0 padrino-core/test/test_routing.rb
@@ -151,6 +151,20 @@ class FooError < RuntimeError; end
assert_equal 404, status
end
+ should "parse params when use regex for parts of a route" do
+ mock_app do
+ post :index, :with => [:foo, :bar], :bar => /.+/ do
+ "show #{params[:foo]}"
+ end
+
+ get :index, :map => '/mystuff/:a_id/boing/:boing_id' do
+ "show #{params[:a_id]} and #{params[:boing_id]}"
+ end
+ end
+ get "/mystuff/5/boing/2"
+ assert_equal "show 5 and 2", body
+ end
+
should "not generate overlapping head urls" do
app = mock_app do
get("/main"){ "hello" }

0 comments on commit 14e2e3c

Please sign in to comment.