mirror of
https://github.com/redmine/redmine.git
synced 2025-11-04 20:35:57 +01:00
Adds a few tests.
git-svn-id: http://svn.redmine.org/redmine/trunk@13695 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user