summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/groups_controller_test.rb12
-rw-r--r--test/integration/routing/groups_test.rb4
2 files changed, 16 insertions, 0 deletions
diff --git a/test/functional/groups_controller_test.rb b/test/functional/groups_controller_test.rb
index 778b3f3cd..f2fa5f04b 100644
--- a/test/functional/groups_controller_test.rb
+++ b/test/functional/groups_controller_test.rb
@@ -113,6 +113,18 @@ class GroupsControllerTest < ActionController::TestCase
assert_redirected_to '/groups'
end
+ def test_new_users
+ get :new_users, :id => 10
+ assert_response :success
+ assert_template 'new_users'
+ end
+
+ def test_xhr_new_users
+ xhr :get, :new_users, :id => 10
+ assert_response :success
+ assert_equal 'text/javascript', response.content_type
+ end
+
def test_add_users
assert_difference 'Group.find(10).users.count', 2 do
post :add_users, :id => 10, :user_ids => ['2', '3']
diff --git a/test/integration/routing/groups_test.rb b/test/integration/routing/groups_test.rb
index ea6e73703..4171a0e25 100644
--- a/test/integration/routing/groups_test.rb
+++ b/test/integration/routing/groups_test.rb
@@ -79,6 +79,10 @@ class RoutingGroupsTest < ActionDispatch::IntegrationTest
def test_groups
assert_routing(
+ { :method => 'get', :path => "/groups/567/users/new" },
+ { :controller => 'groups', :action => 'new_users', :id => '567' }
+ )
+ assert_routing(
{ :method => 'post', :path => "/groups/567/users" },
{ :controller => 'groups', :action => 'add_users', :id => '567' }
)