summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-12-17 13:12:27 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-12-17 13:12:27 +0000
commita59e857d51692b9d51aaae2c32c9b95b2d0fc4a7 (patch)
tree86e059935c6f59b8a2968fd9e9ba5aa72e275135
parent6147a29a68deb01c49afe1a5cc65fbab26d2b20b (diff)
downloadredmine-a59e857d51692b9d51aaae2c32c9b95b2d0fc4a7.tar.gz
redmine-a59e857d51692b9d51aaae2c32c9b95b2d0fc4a7.zip
test: replace "should_route" of "timelogs (scoped under project and issues)" to "assert_routing" at integration/routing_test.rb
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8259 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--test/integration/routing_test.rb81
1 files changed, 65 insertions, 16 deletions
diff --git a/test/integration/routing_test.rb b/test/integration/routing_test.rb
index 0d6638aa1..bc08cf86a 100644
--- a/test/integration/routing_test.rb
+++ b/test/integration/routing_test.rb
@@ -912,22 +912,71 @@ class RoutingTest < ActionController::IntegrationTest
)
end
- context "timelogs (scoped under project and issues)" do
- should_route :get, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook'
- should_route :get, "/projects/ecookbook/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'csv'
- should_route :get, "/projects/ecookbook/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'atom'
- should_route :get, "/projects/ecookbook/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234', :project_id => 'ecookbook'
- should_route :get, "/projects/ecookbook/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234', :project_id => 'ecookbook'
-
- should_route :post, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234', :project_id => 'ecookbook'
-
- should_route :put, "/projects/ecookbook/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234', :project_id => 'ecookbook'
-
- should_route :delete, "/projects/ecookbook/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234', :project_id => 'ecookbook'
-
- should_route :get, "/time_entries/report", :controller => 'timelog', :action => 'report'
- should_route :get, "/projects/567/time_entries/report", :controller => 'timelog', :action => 'report', :project_id => '567'
- should_route :get, "/projects/567/time_entries/report.csv", :controller => 'timelog', :action => 'report', :project_id => '567', :format => 'csv'
+ def test_timelogs_scoped_under_project_and_issues
+ assert_routing(
+ { :method => 'get',
+ :path => "/projects/ecookbook/issues/234/time_entries" },
+ { :controller => 'timelog', :action => 'index',
+ :issue_id => '234', :project_id => 'ecookbook' }
+ )
+ assert_routing(
+ { :method => 'get',
+ :path => "/projects/ecookbook/issues/234/time_entries.csv" },
+ { :controller => 'timelog', :action => 'index',
+ :issue_id => '234', :project_id => 'ecookbook', :format => 'csv' }
+ )
+ assert_routing(
+ { :method => 'get',
+ :path => "/projects/ecookbook/issues/234/time_entries.atom" },
+ { :controller => 'timelog', :action => 'index',
+ :issue_id => '234', :project_id => 'ecookbook', :format => 'atom' }
+ )
+ assert_routing(
+ { :method => 'get',
+ :path => "/projects/ecookbook/issues/234/time_entries/new" },
+ { :controller => 'timelog', :action => 'new',
+ :issue_id => '234', :project_id => 'ecookbook' }
+ )
+ assert_routing(
+ { :method => 'get',
+ :path => "/projects/ecookbook/issues/234/time_entries/22/edit" },
+ { :controller => 'timelog', :action => 'edit', :id => '22',
+ :issue_id => '234', :project_id => 'ecookbook' }
+ )
+ assert_routing(
+ { :method => 'post',
+ :path => "/projects/ecookbook/issues/234/time_entries" },
+ { :controller => 'timelog', :action => 'create',
+ :issue_id => '234', :project_id => 'ecookbook' }
+ )
+ assert_routing(
+ { :method => 'put',
+ :path => "/projects/ecookbook/issues/234/time_entries/22" },
+ { :controller => 'timelog', :action => 'update', :id => '22',
+ :issue_id => '234', :project_id => 'ecookbook' }
+ )
+ assert_routing(
+ { :method => 'delete',
+ :path => "/projects/ecookbook/issues/234/time_entries/55" },
+ { :controller => 'timelog', :action => 'destroy', :id => '55',
+ :issue_id => '234', :project_id => 'ecookbook' }
+ )
+ assert_routing(
+ { :method => 'get',
+ :path => "/time_entries/report" },
+ { :controller => 'timelog', :action => 'report' }
+ )
+ assert_routing(
+ { :method => 'get',
+ :path => "/projects/567/time_entries/report" },
+ { :controller => 'timelog', :action => 'report', :project_id => '567' }
+ )
+ assert_routing(
+ { :method => 'get',
+ :path => "/projects/567/time_entries/report.csv" },
+ { :controller => 'timelog', :action => 'report', :project_id => '567',
+ :format => 'csv' }
+ )
end
def test_users