Rails 2.3.1
Update to the release version of Rails 2.3.1.
This commit is contained in:
parent
bd9fa0ed0c
commit
5e7d2cf973
25 changed files with 199 additions and 26 deletions
|
@ -750,9 +750,17 @@ class ResourcesTest < ActionController::TestCase
|
|||
end
|
||||
|
||||
def test_with_path_segment
|
||||
with_restful_routing :messages, :as => 'reviews' do
|
||||
assert_simply_restful_for :messages, :as => 'reviews'
|
||||
with_restful_routing :messages do
|
||||
assert_simply_restful_for :messages
|
||||
assert_recognizes({:controller => "messages", :action => "index"}, "/messages")
|
||||
assert_recognizes({:controller => "messages", :action => "index"}, "/messages/")
|
||||
end
|
||||
|
||||
with_restful_routing :messages, :as => 'reviews' do
|
||||
assert_simply_restful_for :messages, :as => 'reviews'
|
||||
assert_recognizes({:controller => "messages", :action => "index"}, "/reviews")
|
||||
assert_recognizes({:controller => "messages", :action => "index"}, "/reviews/")
|
||||
end
|
||||
end
|
||||
|
||||
def test_multiple_with_path_segment_and_controller
|
||||
|
|
|
@ -2237,6 +2237,22 @@ class RouteSetTest < Test::Unit::TestCase
|
|||
)
|
||||
end
|
||||
|
||||
def test_format_is_not_inherit
|
||||
set.draw do |map|
|
||||
map.connect '/posts.:format', :controller => 'posts'
|
||||
end
|
||||
|
||||
assert_equal '/posts', set.generate(
|
||||
{:controller => 'posts'},
|
||||
{:controller => 'posts', :action => 'index', :format => 'xml'}
|
||||
)
|
||||
|
||||
assert_equal '/posts.xml', set.generate(
|
||||
{:controller => 'posts', :format => 'xml'},
|
||||
{:controller => 'posts', :action => 'index', :format => 'xml'}
|
||||
)
|
||||
end
|
||||
|
||||
def test_expiry_determination_should_consider_values_with_to_param
|
||||
set.draw { |map| map.connect 'projects/:project_id/:controller/:action' }
|
||||
assert_equal '/projects/1/post/show', set.generate(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue