diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-07-19 16:57:59 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-07-19 16:57:59 +0000 |
commit | 21ee2e2cf246550436b22d5d32698d87839cad6c (patch) | |
tree | fe38d693dd720e069d97a5fe39d886f3baeaeca5 /test/functional/groups_controller_test.rb | |
parent | 035805fbd04286bff0965b588b7c7dbef6652c63 (diff) | |
download | redmine-21ee2e2cf246550436b22d5d32698d87839cad6c.tar.gz redmine-21ee2e2cf246550436b22d5d32698d87839cad6c.zip |
Removes RJS from GroupsController.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10044 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/groups_controller_test.rb')
-rw-r--r-- | test/functional/groups_controller_test.rb | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/test/functional/groups_controller_test.rb b/test/functional/groups_controller_test.rb index 4d5270145..d76a952a5 100644 --- a/test/functional/groups_controller_test.rb +++ b/test/functional/groups_controller_test.rb @@ -113,8 +113,11 @@ class GroupsControllerTest < ActionController::TestCase def test_xhr_add_users assert_difference 'Group.find(10).users.count', 2 do xhr :post, :add_users, :id => 10, :user_ids => ['2', '3'] + assert_response :success + assert_template 'add_users' + assert_equal 'text/javascript', response.content_type end - assert_select_rjs :replace_html, 'tab-content-users' + assert_match /John Smith/, response.body end def test_remove_user @@ -126,8 +129,10 @@ class GroupsControllerTest < ActionController::TestCase def test_xhr_remove_user assert_difference 'Group.find(10).users.count', -1 do xhr :delete, :remove_user, :id => 10, :user_id => '8' + assert_response :success + assert_template 'remove_user' + assert_equal 'text/javascript', response.content_type end - assert_select_rjs :replace_html, 'tab-content-users' end def test_new_membership @@ -139,15 +144,21 @@ class GroupsControllerTest < ActionController::TestCase def test_xhr_new_membership assert_difference 'Group.find(10).members.count' do xhr :post, :edit_membership, :id => 10, :membership => { :project_id => 2, :role_ids => ['1', '2']} + assert_response :success + assert_template 'edit_membership' + assert_equal 'text/javascript', response.content_type end - assert_select_rjs :replace_html, 'tab-content-memberships' + assert_match /OnlineStore/, response.body end def test_xhr_new_membership_with_failure assert_no_difference 'Group.find(10).members.count' do xhr :post, :edit_membership, :id => 10, :membership => { :project_id => 999, :role_ids => ['1', '2']} + assert_response :success + assert_template 'edit_membership' + assert_equal 'text/javascript', response.content_type end - assert @response.body.match(/alert/i), "Alert message not sent" + assert_match /alert/, response.body, "Alert message not sent" end def test_edit_membership @@ -156,6 +167,15 @@ class GroupsControllerTest < ActionController::TestCase end end + def test_xhr_edit_membership + assert_no_difference 'Group.find(10).members.count' do + xhr :post, :edit_membership, :id => 10, :membership_id => 6, :membership => { :role_ids => ['1', '3']} + assert_response :success + assert_template 'edit_membership' + assert_equal 'text/javascript', response.content_type + end + end + def test_destroy_membership assert_difference 'Group.find(10).members.count', -1 do post :destroy_membership, :id => 10, :membership_id => 6 @@ -165,8 +185,10 @@ class GroupsControllerTest < ActionController::TestCase def test_xhr_destroy_membership assert_difference 'Group.find(10).members.count', -1 do xhr :post, :destroy_membership, :id => 10, :membership_id => 6 + assert_response :success + assert_template 'destroy_membership' + assert_equal 'text/javascript', response.content_type end - assert_select_rjs :replace_html, 'tab-content-memberships' end def test_autocomplete_for_user |