Skip to content

Commit

Permalink
Bump rack-mount to 0.6.13 and add test case for named character class…
Browse files Browse the repository at this point in the history
…es [#5509 state:resolved]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
  • Loading branch information
pixeltrix authored and spastorino committed Sep 1, 2010
1 parent 8cba115 commit 69ae216
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion actionpack/actionpack.gemspec
Expand Up @@ -25,7 +25,7 @@ Gem::Specification.new do |s|
s.add_dependency('i18n', '~> 0.4.1') s.add_dependency('i18n', '~> 0.4.1')
s.add_dependency('rack', '~> 1.2.1') s.add_dependency('rack', '~> 1.2.1')
s.add_dependency('rack-test', '~> 0.5.4') s.add_dependency('rack-test', '~> 0.5.4')
s.add_dependency('rack-mount', '~> 0.6.12') s.add_dependency('rack-mount', '~> 0.6.13')
s.add_dependency('tzinfo', '~> 0.3.23') s.add_dependency('tzinfo', '~> 0.3.23')
s.add_dependency('erubis', '~> 2.6.6') s.add_dependency('erubis', '~> 2.6.6')
end end
12 changes: 12 additions & 0 deletions actionpack/test/dispatch/routing_test.rb
Expand Up @@ -442,6 +442,12 @@ def self.matches?(request)
get :preview, :on => :member get :preview, :on => :member
end end


match '/purchases/:token/:filename',
:to => 'purchases#fetch',
:token => /[[:alnum:]]{10}/,
:filename => /(.+)/,
:as => :purchase

scope '/countries/:country', :constraints => lambda { |params, req| %[all France].include?(params[:country]) } do scope '/countries/:country', :constraints => lambda { |params, req| %[all France].include?(params[:country]) } do
match '/', :to => 'countries#index' match '/', :to => 'countries#index'
match '/cities', :to => 'countries#cities' match '/cities', :to => 'countries#cities'
Expand Down Expand Up @@ -2098,6 +2104,12 @@ def test_route_defined_in_resources_scope_level
assert_equal '/customers/1/export', customer_export_path(:customer_id => '1') assert_equal '/customers/1/export', customer_export_path(:customer_id => '1')
end end


def test_named_character_classes_in_regexp_constraints
get '/purchases/315004be7e/Ruby_on_Rails_3.pdf'
assert_equal 'purchases#fetch', @response.body
assert_equal '/purchases/315004be7e/Ruby_on_Rails_3.pdf', purchase_path(:token => '315004be7e', :filename => 'Ruby_on_Rails_3.pdf')
end

private private
def with_test_routes def with_test_routes
yield yield
Expand Down

0 comments on commit 69ae216

Please sign in to comment.