From: Toshi MARUYAMA Date: Sat, 23 Nov 2019 14:26:26 +0000 (+0000) Subject: cleanup: rubocop: fix Layout/IndentFirstHashElement in test/functional/files_controll... X-Git-Tag: 4.2.0~1445 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c87fb4d9073f2c6b591c24365d2c1080db6fa764;p=redmine.git cleanup: rubocop: fix Layout/IndentFirstHashElement in test/functional/files_controller_test.rb git-svn-id: http://svn.redmine.org/redmine/trunk@19195 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/test/functional/files_controller_test.rb b/test/functional/files_controller_test.rb index 59ea2930a..68f32b7cd 100644 --- a/test/functional/files_controller_test.rb +++ b/test/functional/files_controller_test.rb @@ -39,9 +39,12 @@ class FilesControllerTest < Redmine::ControllerTest end def test_index - get :index, :params => { + get( + :index, + :params => { :project_id => 1 } + ) assert_response :success # file attached to the project @@ -53,22 +56,26 @@ class FilesControllerTest < Redmine::ControllerTest def test_new @request.session[:user_id] = 2 - get :new, :params => { + get( + :new, + :params => { :project_id => 1 } + ) assert_response :success - assert_select 'select[name=?]', 'version_id' end def test_new_without_versions Version.delete_all @request.session[:user_id] = 2 - get :new, :params => { + get( + :new, + :params => { :project_id => 1 } + ) assert_response :success - assert_select 'select[name=?]', 'version_id', 0 end @@ -76,17 +83,20 @@ class FilesControllerTest < Redmine::ControllerTest set_tmp_attachments_directory @request.session[:user_id] = 2 ActionMailer::Base.deliveries.clear - with_settings :notified_events => %w(file_added) do assert_difference 'Attachment.count' do - post :create, :params => { + post( + :create, + :params => { :project_id => 1, :version_id => '', :attachments => { '1' => { - 'file' => uploaded_test_file('testfile.txt', 'text/plain')} + 'file' => uploaded_test_file('testfile.txt', 'text/plain') + } } } + ) assert_response :redirect end end @@ -104,16 +114,19 @@ class FilesControllerTest < Redmine::ControllerTest def test_create_version_file set_tmp_attachments_directory @request.session[:user_id] = 2 - assert_difference 'Attachment.count' do - post :create, :params => { + post( + :create, + :params => { :project_id => 1, :version_id => '2', :attachments => { '1' => { - 'file' => uploaded_test_file('testfile.txt', 'text/plain')} + 'file' => uploaded_test_file('testfile.txt', 'text/plain') + } } } + ) assert_response :redirect end assert_redirected_to '/projects/ecookbook/files' @@ -125,12 +138,14 @@ class FilesControllerTest < Redmine::ControllerTest def test_create_without_file set_tmp_attachments_directory @request.session[:user_id] = 2 - assert_no_difference 'Attachment.count' do - post :create, :params => { + post( + :create, + :params => { :project_id => 1, :version_id => '' } + ) assert_response :success end assert_select 'div.error', 'File is invalid'