diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-11-16 14:23:32 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-11-16 14:23:32 +0000 |
commit | ecda1c7a4f30354db74e73eade71550074f67356 (patch) | |
tree | 6f57fba84094ff87a171b05ef3f365bbca69120c /test/integration/routing/versions_test.rb | |
parent | d72e1f95ba4f5c354fbb701808c20c99266077fd (diff) | |
download | redmine-ecda1c7a4f30354db74e73eade71550074f67356.tar.gz redmine-ecda1c7a4f30354db74e73eade71550074f67356.zip |
Use should_route in routing tests.
git-svn-id: http://svn.redmine.org/redmine/trunk@13608 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration/routing/versions_test.rb')
-rw-r--r-- | test/integration/routing/versions_test.rb | 57 |
1 files changed, 12 insertions, 45 deletions
diff --git a/test/integration/routing/versions_test.rb b/test/integration/routing/versions_test.rb index 865bd3bb3..172e8cd56 100644 --- a/test/integration/routing/versions_test.rb +++ b/test/integration/routing/versions_test.rb @@ -17,53 +17,20 @@ require File.expand_path('../../../test_helper', __FILE__) -class RoutingVersionsTest < ActionDispatch::IntegrationTest - def test_roadmap - # /projects/foo/versions is /projects/foo/roadmap - assert_routing( - { :method => 'get', :path => "/projects/33/roadmap" }, - { :controller => 'versions', :action => 'index', :project_id => '33' } - ) - end - - def test_versions_scoped_under_project - assert_routing( - { :method => 'put', :path => "/projects/foo/versions/close_completed" }, - { :controller => 'versions', :action => 'close_completed', - :project_id => 'foo' } - ) - assert_routing( - { :method => 'get', :path => "/projects/foo/versions/new" }, - { :controller => 'versions', :action => 'new', - :project_id => 'foo' } - ) - assert_routing( - { :method => 'post', :path => "/projects/foo/versions" }, - { :controller => 'versions', :action => 'create', - :project_id => 'foo' } - ) +class RoutingVersionsTest < Redmine::RoutingTest + def test_project_versions + should_route 'GET /projects/foo/roadmap' => 'versions#index', :project_id => 'foo' + should_route 'GET /projects/foo/versions/new' => 'versions#new', :project_id => 'foo' + should_route 'POST /projects/foo/versions' => 'versions#create', :project_id => 'foo' + should_route 'PUT /projects/foo/versions/close_completed' => 'versions#close_completed', :project_id => 'foo' end def test_versions - assert_routing( - { :method => 'get', :path => "/versions/1" }, - { :controller => 'versions', :action => 'show', :id => '1' } - ) - assert_routing( - { :method => 'get', :path => "/versions/1/edit" }, - { :controller => 'versions', :action => 'edit', :id => '1' } - ) - assert_routing( - { :method => 'put', :path => "/versions/1" }, - { :controller => 'versions', :action => 'update', :id => '1' } - ) - assert_routing( - { :method => 'delete', :path => "/versions/1" }, - { :controller => 'versions', :action => 'destroy', :id => '1' } - ) - assert_routing( - { :method => 'post', :path => "/versions/1/status_by" }, - { :controller => 'versions', :action => 'status_by', :id => '1' } - ) + should_route 'GET /versions/1' => 'versions#show', :id => '1' + should_route 'GET /versions/1/edit' => 'versions#edit', :id => '1' + should_route 'PUT /versions/1' => 'versions#update', :id => '1' + should_route 'DELETE /versions/1' => 'versions#destroy', :id => '1' + + should_route 'POST /versions/1/status_by' => 'versions#status_by', :id => '1' end end |