summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-01-07 13:20:11 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-01-07 13:20:11 +0000
commitdc8fcbaf036981fa08899f8de46afb8a18e4612a (patch)
treed126e77b326e3a9540a1fae9070f9cbd46457b24 /test
parentc164211c3f357dcd2c607bd014c3b0ed86108098 (diff)
downloadredmine-dc8fcbaf036981fa08899f8de46afb8a18e4612a.tar.gz
redmine-dc8fcbaf036981fa08899f8de46afb8a18e4612a.zip
test: route: add groups tests defined as resources
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8535 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/integration/routing/groups_test.rb66
1 files changed, 66 insertions, 0 deletions
diff --git a/test/integration/routing/groups_test.rb b/test/integration/routing/groups_test.rb
index 644b2e769..f3044db3b 100644
--- a/test/integration/routing/groups_test.rb
+++ b/test/integration/routing/groups_test.rb
@@ -18,6 +18,72 @@
require File.expand_path('../../../test_helper', __FILE__)
class RoutingGroupsTest < ActionController::IntegrationTest
+ def test_groups_resources
+ assert_routing(
+ { :method => 'get', :path => "/groups" },
+ { :controller => 'groups', :action => 'index' }
+ )
+ assert_routing(
+ { :method => 'get', :path => "/groups.xml" },
+ { :controller => 'groups', :action => 'index', :format => 'xml' }
+ )
+ assert_routing(
+ { :method => 'post', :path => "/groups" },
+ { :controller => 'groups', :action => 'create' }
+ )
+ assert_routing(
+ { :method => 'post', :path => "/groups.xml" },
+ { :controller => 'groups', :action => 'create', :format => 'xml' }
+ )
+ assert_routing(
+ { :method => 'get', :path => "/groups/new" },
+ { :controller => 'groups', :action => 'new' }
+ )
+ assert_routing(
+ { :method => 'get', :path => "/groups/new.xml" },
+ { :controller => 'groups', :action => 'new', :format => 'xml' }
+ )
+ assert_routing(
+ { :method => 'get', :path => "/groups/1/edit" },
+ { :controller => 'groups', :action => 'edit', :id => '1' }
+ )
+ assert_routing(
+ { :method => 'get', :path => "/groups/1/autocomplete_for_user" },
+ { :controller => 'groups', :action => 'autocomplete_for_user',
+ :id => '1' }
+ )
+ assert_routing(
+ { :method => 'get', :path => "/groups/1" },
+ { :controller => 'groups', :action => 'show',
+ :id => '1' }
+ )
+ assert_routing(
+ { :method => 'get', :path => "/groups/1.xml" },
+ { :controller => 'groups', :action => 'show',
+ :format => 'xml', :id => '1' }
+ )
+ assert_routing(
+ { :method => 'put', :path => "/groups/1" },
+ { :controller => 'groups', :action => 'update',
+ :id => '1' }
+ )
+ assert_routing(
+ { :method => 'put', :path => "/groups/1.xml" },
+ { :controller => 'groups', :action => 'update',
+ :format => 'xml', :id => '1' }
+ )
+ assert_routing(
+ { :method => 'delete', :path => "/groups/1" },
+ { :controller => 'groups', :action => 'destroy',
+ :id => '1' }
+ )
+ assert_routing(
+ { :method => 'delete', :path => "/groups/1.xml" },
+ { :controller => 'groups', :action => 'destroy',
+ :format => 'xml', :id => '1' }
+ )
+ end
+
def test_groups
assert_routing(
{ :method => 'post', :path => "/groups/567/users" },