Removes RJS from WatchersController.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10047 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user