summaryrefslogtreecommitdiffstats
path: root/test/functional/repositories_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-07-19 17:27:14 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-07-19 17:27:14 +0000
commit87da04c808e20d47ced23fa758512d5367a076b7 (patch)
tree214e1f1dc663b6fae72e169c97c3cf5a0f716059 /test/functional/repositories_controller_test.rb
parent38060a2cf0132a702c91adf60f344ad28c4e8e00 (diff)
downloadredmine-87da04c808e20d47ced23fa758512d5367a076b7.tar.gz
redmine-87da04c808e20d47ced23fa758512d5367a076b7.zip
Removes RJS from RepositoriesController.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10048 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/repositories_controller_test.rb')
-rw-r--r--test/functional/repositories_controller_test.rb19
1 files changed, 13 insertions, 6 deletions
diff --git a/test/functional/repositories_controller_test.rb b/test/functional/repositories_controller_test.rb
index 213a1f81a..3304127e1 100644
--- a/test/functional/repositories_controller_test.rb
+++ b/test/functional/repositories_controller_test.rb
@@ -171,20 +171,25 @@ class RepositoriesControllerTest < ActionController::TestCase
def test_add_related_issue
@request.session[:user_id] = 2
assert_difference 'Changeset.find(103).issues.size' do
- post :add_related_issue, :id => 1, :rev => 4, :issue_id => 2, :format => 'js'
+ xhr :post, :add_related_issue, :id => 1, :rev => 4, :issue_id => 2, :format => 'js'
assert_response :success
+ assert_template 'add_related_issue'
+ assert_equal 'text/javascript', response.content_type
end
- assert_select_rjs :replace_html, 'related-issues'
assert_equal [2], Changeset.find(103).issue_ids
+ assert_include 'related-issues', response.body
+ assert_include 'Feature request #2', response.body
end
def test_add_related_issue_with_invalid_issue_id
@request.session[:user_id] = 2
assert_no_difference 'Changeset.find(103).issues.size' do
- post :add_related_issue, :id => 1, :rev => 4, :issue_id => 9999, :format => 'js'
+ xhr :post, :add_related_issue, :id => 1, :rev => 4, :issue_id => 9999, :format => 'js'
assert_response :success
+ assert_template 'add_related_issue'
+ assert_equal 'text/javascript', response.content_type
end
- assert_include 'alert("Issue is invalid")', @response.body
+ assert_include 'alert("Issue is invalid")', response.body
end
def test_remove_related_issue
@@ -193,11 +198,13 @@ class RepositoriesControllerTest < ActionController::TestCase
@request.session[:user_id] = 2
assert_difference 'Changeset.find(103).issues.size', -1 do
- delete :remove_related_issue, :id => 1, :rev => 4, :issue_id => 2, :format => 'js'
+ xhr :delete, :remove_related_issue, :id => 1, :rev => 4, :issue_id => 2, :format => 'js'
assert_response :success
+ assert_template 'remove_related_issue'
+ assert_equal 'text/javascript', response.content_type
end
- assert_select_rjs :remove, 'related-issue-2'
assert_equal [1], Changeset.find(103).issue_ids
+ assert_include 'related-issue-2', response.body
end
def test_graph_commits_per_month