diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-12-30 05:14:01 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-12-30 05:14:01 +0000 |
commit | 1b252d68f3da0a4e8c35df5238255a66361bf673 (patch) | |
tree | 84465d0c2e8bba14ae0561beded098309dade25b /test/integration | |
parent | ba445483323132580d98dfd2084aaaaf782a4fa8 (diff) | |
download | redmine-1b252d68f3da0a4e8c35df5238255a66361bf673.tar.gz redmine-1b252d68f3da0a4e8c35df5238255a66361bf673.zip |
test: route: split news tests whether scoped under project or not
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8432 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration')
-rw-r--r-- | test/integration/routing/news_test.rb | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/test/integration/routing/news_test.rb b/test/integration/routing/news_test.rb index 08e1aeee1..70c8b3afd 100644 --- a/test/integration/routing/news_test.rb +++ b/test/integration/routing/news_test.rb @@ -36,6 +36,29 @@ class RoutingNewsTest < ActionController::IntegrationTest { :controller => 'news', :action => 'index', :format => 'json' } ) assert_routing( + { :method => 'get', :path => "/news/2" }, + { :controller => 'news', :action => 'show', :id => '2' } + ) + assert_routing( + { :method => 'get', :path => "/news/234" }, + { :controller => 'news', :action => 'show', :id => '234' } + ) + assert_routing( + { :method => 'get', :path => "/news/567/edit" }, + { :controller => 'news', :action => 'edit', :id => '567' } + ) + assert_routing( + { :method => 'put', :path => "/news/567" }, + { :controller => 'news', :action => 'update', :id => '567' } + ) + assert_routing( + { :method => 'delete', :path => "/news/567" }, + { :controller => 'news', :action => 'destroy', :id => '567' } + ) + end + + def test_news_scoped_under_project + assert_routing( { :method => 'get', :path => "/projects/567/news" }, { :controller => 'news', :action => 'index', :project_id => '567' } ) @@ -55,32 +78,12 @@ class RoutingNewsTest < ActionController::IntegrationTest :project_id => '567' } ) assert_routing( - { :method => 'get', :path => "/news/2" }, - { :controller => 'news', :action => 'show', :id => '2' } - ) - assert_routing( { :method => 'get', :path => "/projects/567/news/new" }, { :controller => 'news', :action => 'new', :project_id => '567' } ) assert_routing( - { :method => 'get', :path => "/news/234" }, - { :controller => 'news', :action => 'show', :id => '234' } - ) - assert_routing( - { :method => 'get', :path => "/news/567/edit" }, - { :controller => 'news', :action => 'edit', :id => '567' } - ) - assert_routing( { :method => 'post', :path => "/projects/567/news" }, { :controller => 'news', :action => 'create', :project_id => '567' } ) - assert_routing( - { :method => 'put', :path => "/news/567" }, - { :controller => 'news', :action => 'update', :id => '567' } - ) - assert_routing( - { :method => 'delete', :path => "/news/567" }, - { :controller => 'news', :action => 'destroy', :id => '567' } - ) end end |