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
+ post :add_related_issue, :id => 1, :rev => 4, :issue_id => 2, :format => 'js'
assert_response :success
end
assert_select_rjs :replace_html, 'related-issues'
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
+ post :add_related_issue, :id => 1, :rev => 4, :issue_id => 9999, :format => 'js'
assert_response :success
end
assert_include 'alert("Issue is invalid")', @response.body
@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
+ delete :remove_related_issue, :id => 1, :rev => 4, :issue_id => 2, :format => 'js'
assert_response :success
end
assert_select_rjs :remove, 'related-issue-2'