diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-12-16 12:11:05 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-12-16 12:11:05 +0000 |
commit | 14b931eb4a93fd0a55ca0959e0e8253d6f27e7a7 (patch) | |
tree | 4f20a91fd27abac3c9d12dc5ef395accc7d8a047 /test/integration/routing_test.rb | |
parent | bc548368e89024cd84928397ea1fe2efccc94d5c (diff) | |
download | redmine-14b931eb4a93fd0a55ca0959e0e8253d6f27e7a7.tar.gz redmine-14b931eb4a93fd0a55ca0959e0e8253d6f27e7a7.zip |
test: replace "should_route" of "timelogs (scoped under issues)" to "assert_routing" at integration/routing_test.rb
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8247 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration/routing_test.rb')
-rw-r--r-- | test/integration/routing_test.rb | 50 |
1 files changed, 38 insertions, 12 deletions
diff --git a/test/integration/routing_test.rb b/test/integration/routing_test.rb index 914f5f470..580805d64 100644 --- a/test/integration/routing_test.rb +++ b/test/integration/routing_test.rb @@ -704,18 +704,44 @@ class RoutingTest < ActionController::IntegrationTest ) end - context "timelogs (scoped under issues)" do - should_route :get, "/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234' - should_route :get, "/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :format => 'csv' - should_route :get, "/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :format => 'atom' - should_route :get, "/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234' - should_route :get, "/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234' - - should_route :post, "/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234' - - should_route :put, "/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234' - - should_route :delete, "/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234' + def test_timelogs_scoped_under_issues + assert_routing( + { :method => 'get', :path => "/issues/234/time_entries" }, + { :controller => 'timelog', :action => 'index', :issue_id => '234' } + ) + assert_routing( + { :method => 'get', :path => "/issues/234/time_entries.csv" }, + { :controller => 'timelog', :action => 'index', :issue_id => '234', + :format => 'csv' } + ) + assert_routing( + { :method => 'get', :path => "/issues/234/time_entries.atom" }, + { :controller => 'timelog', :action => 'index', :issue_id => '234', + :format => 'atom' } + ) + assert_routing( + { :method => 'get', :path => "/issues/234/time_entries/new" }, + { :controller => 'timelog', :action => 'new', :issue_id => '234' } + ) + assert_routing( + { :method => 'get', :path => "/issues/234/time_entries/22/edit" }, + { :controller => 'timelog', :action => 'edit', :id => '22', + :issue_id => '234' } + ) + assert_routing( + { :method => 'post', :path => "/issues/234/time_entries" }, + { :controller => 'timelog', :action => 'create', :issue_id => '234' } + ) + assert_routing( + { :method => 'put', :path => "/issues/234/time_entries/22" }, + { :controller => 'timelog', :action => 'update', :id => '22', + :issue_id => '234' } + ) + assert_routing( + { :method => 'delete', :path => "/issues/234/time_entries/55" }, + { :controller => 'timelog', :action => 'destroy', :id => '55', + :issue_id => '234' } + ) end context "timelogs (scoped under project and issues)" do |