]> source.dussan.org Git - redmine.git/commitdiff
test: route: move timelogs tests to new file
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 24 Dec 2011 04:13:38 +0000 (04:13 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 24 Dec 2011 04:13:38 +0000 (04:13 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8343 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/integration/routing/timelog_test.rb [new file with mode: 0644]
test/integration/routing_test.rb

diff --git a/test/integration/routing/timelog_test.rb b/test/integration/routing/timelog_test.rb
new file mode 100644 (file)
index 0000000..b5ce892
--- /dev/null
@@ -0,0 +1,203 @@
+# Redmine - project management software
+# Copyright (C) 2006-2011  Jean-Philippe Lang
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+
+require File.expand_path('../../../test_helper', __FILE__)
+
+class RoutingTimelogsTest < ActionController::IntegrationTest
+  def test_timelogs_global
+    assert_routing(
+        { :method => 'get', :path => "/time_entries" },
+        { :controller => 'timelog', :action => 'index' }
+      )
+    assert_routing(
+        { :method => 'get', :path => "/time_entries.csv" },
+        { :controller => 'timelog', :action => 'index', :format => 'csv' }
+      )
+    assert_routing(
+        { :method => 'get', :path => "/time_entries.atom" },
+        { :controller => 'timelog', :action => 'index', :format => 'atom' }
+      )
+    assert_routing(
+        { :method => 'get', :path => "/time_entries/new" },
+        { :controller => 'timelog', :action => 'new' }
+      )
+    assert_routing(
+        { :method => 'get', :path => "/time_entries/22/edit" },
+        { :controller => 'timelog', :action => 'edit', :id => '22' }
+      )
+    assert_routing(
+        { :method => 'post', :path => "/time_entries" },
+        { :controller => 'timelog', :action => 'create' }
+      )
+    assert_routing(
+        { :method => 'put', :path => "/time_entries/22" },
+        { :controller => 'timelog', :action => 'update', :id => '22' }
+      )
+    assert_routing(
+        { :method => 'delete', :path => "/time_entries/55" },
+        { :controller => 'timelog', :action => 'destroy', :id => '55' }
+      )
+  end
+
+  def test_timelogs_scoped_under_project
+    assert_routing(
+        { :method => 'get', :path => "/projects/567/time_entries" },
+        { :controller => 'timelog', :action => 'index', :project_id => '567' }
+      )
+    assert_routing(
+        { :method => 'get', :path => "/projects/567/time_entries.csv" },
+        { :controller => 'timelog', :action => 'index', :project_id => '567',
+          :format => 'csv' }
+      )
+    assert_routing(
+        { :method => 'get', :path => "/projects/567/time_entries.atom" },
+        { :controller => 'timelog', :action => 'index', :project_id => '567',
+          :format => 'atom' }
+      )
+    assert_routing(
+        { :method => 'get', :path => "/projects/567/time_entries/new" },
+        { :controller => 'timelog', :action => 'new', :project_id => '567' }
+      )
+    assert_routing(
+        { :method => 'get', :path => "/projects/567/time_entries/22/edit" },
+        { :controller => 'timelog', :action => 'edit',
+          :id => '22', :project_id => '567' }
+      )
+    assert_routing(
+        { :method => 'post', :path => "/projects/567/time_entries" },
+        { :controller => 'timelog', :action => 'create',
+          :project_id => '567' }
+      )
+    assert_routing(
+        { :method => 'put', :path => "/projects/567/time_entries/22" },
+        { :controller => 'timelog', :action => 'update',
+          :id => '22', :project_id => '567' }
+      )
+    assert_routing(
+        { :method => 'delete', :path => "/projects/567/time_entries/55" },
+        { :controller => 'timelog', :action => 'destroy',
+          :id => '55', :project_id => '567' }
+      )
+  end
+
+  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
+
+  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
+end
index afe0d75db7a7c64b49e8f74b6f5437b8183d2922..82be3b451fb943d8f83d21224a873d637926054e 100644 (file)
@@ -475,189 +475,6 @@ class RoutingTest < ActionController::IntegrationTest
       )
   end
 
-  def test_timelogs_global
-    assert_routing(
-        { :method => 'get', :path => "/time_entries" },
-        { :controller => 'timelog', :action => 'index' }
-      )
-    assert_routing(
-        { :method => 'get', :path => "/time_entries.csv" },
-        { :controller => 'timelog', :action => 'index', :format => 'csv' }
-      )
-    assert_routing(
-        { :method => 'get', :path => "/time_entries.atom" },
-        { :controller => 'timelog', :action => 'index', :format => 'atom' }
-      )
-    assert_routing(
-        { :method => 'get', :path => "/time_entries/new" },
-        { :controller => 'timelog', :action => 'new' }
-      )
-    assert_routing(
-        { :method => 'get', :path => "/time_entries/22/edit" },
-        { :controller => 'timelog', :action => 'edit', :id => '22' }
-      )
-    assert_routing(
-        { :method => 'post', :path => "/time_entries" },
-        { :controller => 'timelog', :action => 'create' }
-      )
-    assert_routing(
-        { :method => 'put', :path => "/time_entries/22" },
-        { :controller => 'timelog', :action => 'update', :id => '22' }
-      )
-    assert_routing(
-        { :method => 'delete', :path => "/time_entries/55" },
-        { :controller => 'timelog', :action => 'destroy', :id => '55' }
-      )
-  end
-
-  def test_timelogs_scoped_under_project
-    assert_routing(
-        { :method => 'get', :path => "/projects/567/time_entries" },
-        { :controller => 'timelog', :action => 'index', :project_id => '567' }
-      )
-    assert_routing(
-        { :method => 'get', :path => "/projects/567/time_entries.csv" },
-        { :controller => 'timelog', :action => 'index', :project_id => '567',
-          :format => 'csv' }
-      )
-    assert_routing(
-        { :method => 'get', :path => "/projects/567/time_entries.atom" },
-        { :controller => 'timelog', :action => 'index', :project_id => '567',
-          :format => 'atom' }
-      )
-    assert_routing(
-        { :method => 'get', :path => "/projects/567/time_entries/new" },
-        { :controller => 'timelog', :action => 'new', :project_id => '567' }
-      )
-    assert_routing(
-        { :method => 'get', :path => "/projects/567/time_entries/22/edit" },
-        { :controller => 'timelog', :action => 'edit',
-          :id => '22', :project_id => '567' }
-      )
-    assert_routing(
-        { :method => 'post', :path => "/projects/567/time_entries" },
-        { :controller => 'timelog', :action => 'create',
-          :project_id => '567' }
-      )
-    assert_routing(
-        { :method => 'put', :path => "/projects/567/time_entries/22" },
-        { :controller => 'timelog', :action => 'update',
-          :id => '22', :project_id => '567' }
-      )
-    assert_routing(
-        { :method => 'delete', :path => "/projects/567/time_entries/55" },
-        { :controller => 'timelog', :action => 'destroy',
-          :id => '55', :project_id => '567' }
-      )
-  end
-
-  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
-
-  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
     assert_routing(
         { :method => 'get', :path => "/users" },