diff options
author | Go MAEDA <maeda@farend.jp> | 2019-10-04 11:17:33 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2019-10-04 11:17:33 +0000 |
commit | 5ce4a363a951e4a64afd29bbe216b83fe4fdcc12 (patch) | |
tree | 33f3e2c8f59467f435f7a0f960b21d58eff87d73 /test/functional | |
parent | b83402029721fd5813e3ae6c1eea5fc644651ebf (diff) | |
download | redmine-5ce4a363a951e4a64afd29bbe216b83fe4fdcc12.tar.gz redmine-5ce4a363a951e4a64afd29bbe216b83fe4fdcc12.zip |
Fix test failure due to missing call to set_tmp_attachments_directory (#32122).
Patch by Yuichi HARADA.
git-svn-id: http://svn.redmine.org/redmine/trunk@18593 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/documents_controller_test.rb | 2 | ||||
-rw-r--r-- | test/functional/issues_controller_test.rb | 28 | ||||
-rw-r--r-- | test/functional/journals_controller_test.rb | 1 | ||||
-rw-r--r-- | test/functional/messages_controller_test.rb | 1 | ||||
-rw-r--r-- | test/functional/projects_controller_test.rb | 2 | ||||
-rw-r--r-- | test/functional/wiki_controller_test.rb | 3 | ||||
-rw-r--r-- | test/functional/wikis_controller_test.rb | 2 |
7 files changed, 31 insertions, 8 deletions
diff --git a/test/functional/documents_controller_test.rb b/test/functional/documents_controller_test.rb index d0e586649..8eb741249 100644 --- a/test/functional/documents_controller_test.rb +++ b/test/functional/documents_controller_test.rb @@ -234,6 +234,7 @@ LOREM end def test_destroy + set_tmp_attachments_directory @request.session[:user_id] = 2 assert_difference 'Document.count', -1 do delete :destroy, :params => { @@ -245,6 +246,7 @@ LOREM end def test_add_attachment + set_tmp_attachments_directory @request.session[:user_id] = 2 assert_difference 'Attachment.count' do post :add_attachment, :params => { diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index adbe6b794..6f9ff1dfa 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -348,6 +348,7 @@ class IssuesControllerTest < Redmine::ControllerTest end def test_index_grouped_by_due_date + set_tmp_attachments_directory Issue.destroy_all Issue.generate!(:due_date => '2018-08-10') Issue.generate!(:due_date => '2018-08-10') @@ -4413,6 +4414,7 @@ class IssuesControllerTest < Redmine::ControllerTest end def test_create_as_copy_with_attachments_should_also_add_new_files + set_tmp_attachments_directory @request.session[:user_id] = 2 issue = Issue.find(3) count = issue.attachments.count @@ -6670,6 +6672,7 @@ class IssuesControllerTest < Redmine::ControllerTest end def test_destroy_issue_with_no_time_entries_should_delete_the_issues + set_tmp_attachments_directory assert_nil TimeEntry.find_by_issue_id(2) @request.session[:user_id] = 2 @@ -6683,6 +6686,7 @@ class IssuesControllerTest < Redmine::ControllerTest end def test_destroy_issues_with_time_entries_should_show_the_reassign_form + set_tmp_attachments_directory @request.session[:user_id] = 2 with_settings :timelog_required_fields => [] do @@ -6703,18 +6707,19 @@ class IssuesControllerTest < Redmine::ControllerTest end def test_destroy_issues_with_time_entries_should_not_show_the_nullify_option_when_issue_is_required_for_time_entries + set_tmp_attachments_directory with_settings :timelog_required_fields => ['issue_id'] do @request.session[:user_id] = 2 - assert_no_difference 'Issue.count' do - delete :destroy, :params => { - :ids => [1, 3] - } - end - assert_response :success + assert_no_difference 'Issue.count' do + delete :destroy, :params => { + :ids => [1, 3] + } + end + assert_response :success - assert_select 'form' do - assert_select 'input[name=_method][value=delete]' + assert_select 'form' do + assert_select 'input[name=_method][value=delete]' assert_select 'input[name=todo][value=destroy]' assert_select 'input[name=todo][value=nullify]', 0 assert_select 'input[name=todo][value=reassign]' @@ -6739,6 +6744,7 @@ class IssuesControllerTest < Redmine::ControllerTest end def test_destroy_issues_and_destroy_time_entries + set_tmp_attachments_directory @request.session[:user_id] = 2 assert_difference 'Issue.count', -2 do @@ -6755,6 +6761,7 @@ class IssuesControllerTest < Redmine::ControllerTest end def test_destroy_issues_and_assign_time_entries_to_project + set_tmp_attachments_directory @request.session[:user_id] = 2 with_settings :timelog_required_fields => [] do @@ -6774,6 +6781,7 @@ class IssuesControllerTest < Redmine::ControllerTest end def test_destroy_issues_and_reassign_time_entries_to_another_issue + set_tmp_attachments_directory @request.session[:user_id] = 2 assert_difference 'Issue.count', -2 do @@ -6814,6 +6822,7 @@ class IssuesControllerTest < Redmine::ControllerTest end def test_destroy_issues_and_reassign_time_entries_to_an_invalid_issue_should_fail + set_tmp_attachments_directory @request.session[:user_id] = 2 assert_no_difference 'Issue.count' do @@ -6830,6 +6839,7 @@ class IssuesControllerTest < Redmine::ControllerTest end def test_destroy_issues_and_reassign_time_entries_to_an_issue_to_delete_should_fail + set_tmp_attachments_directory @request.session[:user_id] = 2 assert_no_difference 'Issue.count' do @@ -6846,6 +6856,7 @@ class IssuesControllerTest < Redmine::ControllerTest end def test_destroy_issues_and_nullify_time_entries_should_fail_when_issue_is_required_for_time_entries + set_tmp_attachments_directory @request.session[:user_id] = 2 with_settings :timelog_required_fields => ['issue_id'] do @@ -6863,6 +6874,7 @@ class IssuesControllerTest < Redmine::ControllerTest end def test_destroy_issues_from_different_projects + set_tmp_attachments_directory @request.session[:user_id] = 2 assert_difference 'Issue.count', -3 do diff --git a/test/functional/journals_controller_test.rb b/test/functional/journals_controller_test.rb index b003a3659..b5df9cffa 100644 --- a/test/functional/journals_controller_test.rb +++ b/test/functional/journals_controller_test.rb @@ -62,6 +62,7 @@ class JournalsControllerTest < Redmine::ControllerTest end def test_index_should_show_visible_custom_fields_only + set_tmp_attachments_directory Issue.destroy_all Journal.delete_all field_attributes = {:field_format => 'string', :is_for_all => true, :is_filter => true, :trackers => Tracker.all} diff --git a/test/functional/messages_controller_test.rb b/test/functional/messages_controller_test.rb index 64c70157b..ad193b119 100644 --- a/test/functional/messages_controller_test.rb +++ b/test/functional/messages_controller_test.rb @@ -232,6 +232,7 @@ class MessagesControllerTest < Redmine::ControllerTest end def test_destroy_topic + set_tmp_attachments_directory @request.session[:user_id] = 2 assert_difference 'Message.count', -3 do post :destroy, :params => { diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb index 63159ab90..cd1476a76 100644 --- a/test/functional/projects_controller_test.rb +++ b/test/functional/projects_controller_test.rb @@ -834,6 +834,7 @@ class ProjectsControllerTest < Redmine::ControllerTest end def test_destroy_without_confirmation_should_show_confirmation_with_subprojects + set_tmp_attachments_directory @request.session[:user_id] = 1 # admin assert_no_difference 'Project.count' do @@ -849,6 +850,7 @@ class ProjectsControllerTest < Redmine::ControllerTest end def test_destroy_with_confirmation_should_destroy_the_project_and_subprojects + set_tmp_attachments_directory @request.session[:user_id] = 1 # admin assert_difference 'Project.count', -5 do diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb index 6ee3bff51..7d36ea3f2 100644 --- a/test/functional/wiki_controller_test.rb +++ b/test/functional/wiki_controller_test.rb @@ -273,6 +273,7 @@ class WikiControllerTest < Redmine::ControllerTest end def test_create_page_with_attachments + set_tmp_attachments_directory @request.session[:user_id] = 2 assert_difference 'WikiPage.count' do assert_difference 'Attachment.count' do @@ -443,6 +444,7 @@ class WikiControllerTest < Redmine::ControllerTest end def test_update_page_with_attachments_only_should_not_create_content_version + set_tmp_attachments_directory @request.session[:user_id] = 2 assert_no_difference 'WikiPage.count' do assert_no_difference 'WikiContent.count' do @@ -1179,6 +1181,7 @@ class WikiControllerTest < Redmine::ControllerTest end def test_add_attachment + set_tmp_attachments_directory @request.session[:user_id] = 2 assert_difference 'Attachment.count' do post :add_attachment, :params => { diff --git a/test/functional/wikis_controller_test.rb b/test/functional/wikis_controller_test.rb index 5b53aaae8..fad3d8365 100644 --- a/test/functional/wikis_controller_test.rb +++ b/test/functional/wikis_controller_test.rb @@ -27,6 +27,7 @@ class WikisControllerTest < Redmine::ControllerTest end def test_get_destroy_should_ask_confirmation + set_tmp_attachments_directory @request.session[:user_id] = 1 assert_no_difference 'Wiki.count' do get :destroy, :params => {:id => 1} @@ -35,6 +36,7 @@ class WikisControllerTest < Redmine::ControllerTest end def test_post_destroy_should_delete_wiki + set_tmp_attachments_directory @request.session[:user_id] = 1 post :destroy, :params => {:id => 1, :confirm => 1} assert_redirected_to :controller => 'projects', |