summaryrefslogtreecommitdiffstats
path: root/test/functional
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-07-19 17:17:10 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-07-19 17:17:10 +0000
commit38060a2cf0132a702c91adf60f344ad28c4e8e00 (patch)
tree217c5f7885a9c48ab8c006d4ba84862ee91e141d /test/functional
parentc178aded61c24b6037cd2dc403161427c8c0f836 (diff)
downloadredmine-38060a2cf0132a702c91adf60f344ad28c4e8e00.tar.gz
redmine-38060a2cf0132a702c91adf60f344ad28c4e8e00.zip
Removes RJS from WatchersController.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10047 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/watchers_controller_test.rb22
1 files changed, 10 insertions, 12 deletions
diff --git a/test/functional/watchers_controller_test.rb b/test/functional/watchers_controller_test.rb
index bef8aae9b..91324edf0 100644
--- a/test/functional/watchers_controller_test.rb
+++ b/test/functional/watchers_controller_test.rb
@@ -81,7 +81,7 @@ class WatchersControllerTest < ActionController::TestCase
@request.session[:user_id] = 2
xhr :get, :new, :object_type => 'issue', :object_id => '2'
assert_response :success
- assert_select_rjs :replace_html, 'ajax-modal'
+ assert_match /ajax-modal/, response.body
end
def test_new_for_new_record_with_id
@@ -89,7 +89,7 @@ class WatchersControllerTest < ActionController::TestCase
xhr :get, :new, :project_id => 1
assert_response :success
assert_equal Project.find(1), assigns(:project)
- assert_select_rjs :replace_html, 'ajax-modal'
+ assert_match /ajax-modal/, response.body
end
def test_new_for_new_record_with_identifier
@@ -97,7 +97,7 @@ class WatchersControllerTest < ActionController::TestCase
xhr :get, :new, :project_id => 'ecookbook'
assert_response :success
assert_equal Project.find(1), assigns(:project)
- assert_select_rjs :replace_html, 'ajax-modal'
+ assert_match /ajax-modal/, response.body
end
def test_create
@@ -105,8 +105,8 @@ class WatchersControllerTest < ActionController::TestCase
assert_difference('Watcher.count') do
xhr :post, :create, :object_type => 'issue', :object_id => '2', :watcher => {:user_id => '4'}
assert_response :success
- assert_select_rjs :replace_html, 'watchers'
- assert_select_rjs :replace_html, 'ajax-modal'
+ assert_match /watchers/, response.body
+ assert_match /ajax-modal/, response.body
end
assert Issue.find(2).watched_by?(User.find(4))
end
@@ -116,8 +116,8 @@ class WatchersControllerTest < ActionController::TestCase
assert_difference('Watcher.count', 2) do
xhr :post, :create, :object_type => 'issue', :object_id => '2', :watcher => {:user_ids => ['4', '7']}
assert_response :success
- assert_select_rjs :replace_html, 'watchers'
- assert_select_rjs :replace_html, 'ajax-modal'
+ assert_match /watchers/, response.body
+ assert_match /ajax-modal/, response.body
end
assert Issue.find(2).watched_by?(User.find(4))
assert Issue.find(2).watched_by?(User.find(7))
@@ -148,10 +148,8 @@ class WatchersControllerTest < ActionController::TestCase
assert_no_difference 'Watcher.count' do
xhr :post, :append, :watcher => {:user_ids => ['4', '7']}
assert_response :success
- assert_select_rjs :insert_html, 'watchers_inputs' do
- assert_select 'input[name=?][value=4]', 'issue[watcher_user_ids][]'
- assert_select 'input[name=?][value=7]', 'issue[watcher_user_ids][]'
- end
+ assert_include 'watchers_inputs', response.body
+ assert_include 'issue[watcher_user_ids][]', response.body
end
end
@@ -160,7 +158,7 @@ class WatchersControllerTest < ActionController::TestCase
assert_difference('Watcher.count', -1) do
xhr :post, :destroy, :object_type => 'issue', :object_id => '2', :user_id => '3'
assert_response :success
- assert_select_rjs :replace_html, 'watchers'
+ assert_match /watchers/, response.body
end
assert !Issue.find(2).watched_by?(User.find(3))
end