Adds a few tests.

git-svn-id: http://svn.redmine.org/redmine/trunk@13695 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2014-12-03 20:21:03 +00:00
parent 1059f9a99e
commit 5222650d95
9 changed files with 127 additions and 3 deletions

View File

@@ -1741,6 +1741,12 @@ class IssuesControllerTest < ActionController::TestCase
assert_select_error /No tracker/
end
def test_new_with_invalid_project_id
@request.session[:user_id] = 1
get :new, :project_id => 'invalid'
assert_response 404
end
def test_update_form_for_new_issue
@request.session[:user_id] = 2
xhr :post, :update_form, :project_id => 1,
@@ -4032,6 +4038,19 @@ class IssuesControllerTest < ActionController::TestCase
assert_equal 2, TimeEntry.find(2).issue_id
end
def test_destroy_issues_and_reassign_time_entries_to_an_invalid_issue_should_fail
@request.session[:user_id] = 2
assert_no_difference 'Issue.count' do
assert_no_difference 'TimeEntry.count' do
# try to reassign time to an issue of another project
delete :destroy, :ids => [1, 3], :todo => 'reassign', :reassign_to_id => 4
end
end
assert_response :success
assert_template 'destroy'
end
def test_destroy_issues_from_different_projects
@request.session[:user_id] = 2