From c20f1d0aaa107c0e1665f2a93e6dcfafd905d806 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sun, 24 Nov 2019 13:19:17 +0000 Subject: [PATCH] cleanup: rubocop: fix Layout/IndentFirstHashElement in test/functional/mail_handler_controller_test.rb git-svn-id: http://svn.redmine.org/redmine/trunk@19258 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- .../mail_handler_controller_test.rb | 40 ++++++++++++------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/test/functional/mail_handler_controller_test.rb b/test/functional/mail_handler_controller_test.rb index 6fb0a6913..a669a6cd5 100644 --- a/test/functional/mail_handler_controller_test.rb +++ b/test/functional/mail_handler_controller_test.rb @@ -35,10 +35,13 @@ class MailHandlerControllerTest < Redmine::ControllerTest Setting.mail_handler_api_key = 'secret' assert_difference 'Issue.count' do - post :index, :params => { + post( + :index, + :params => { :key => 'secret', :email => IO.read(File.join(FIXTURES_PATH, 'ticket_on_given_project.eml')) } + ) end assert_response 201 end @@ -47,15 +50,17 @@ class MailHandlerControllerTest < Redmine::ControllerTest # Enable API and set a key Setting.mail_handler_api_enabled = 1 Setting.mail_handler_api_key = 'secret' - assert_difference 'Issue.count' do - post :index, :params => { + post( + :index, + :params => { :key => 'secret', :email => IO.read(File.join(FIXTURES_PATH, 'ticket_on_given_project.eml')), :issue => { :is_private => '1' } } + ) end assert_response 201 issue = Issue.order(:id => :desc).first @@ -66,13 +71,15 @@ class MailHandlerControllerTest < Redmine::ControllerTest # Enable API and set a key Setting.mail_handler_api_enabled = 1 Setting.mail_handler_api_key = 'secret' - assert_no_difference 'Issue.count' do assert_difference 'Journal.count' do - post :index, :params => { + post( + :index, + :params => { :key => 'secret', :email => IO.read(File.join(FIXTURES_PATH, 'ticket_reply.eml')) } + ) end end assert_response 201 @@ -83,12 +90,14 @@ class MailHandlerControllerTest < Redmine::ControllerTest Setting.mail_handler_api_enabled = 1 Setting.mail_handler_api_key = 'secret' - assert_no_difference 'Issue.count' do - post :index, :params => { + post( + :index, + :params => { :key => 'secret', :email => IO.read(File.join(FIXTURES_PATH, 'ticket_on_given_project.eml')) } + ) end assert_response 422 end @@ -97,12 +106,14 @@ class MailHandlerControllerTest < Redmine::ControllerTest # Disable API Setting.mail_handler_api_enabled = 0 Setting.mail_handler_api_key = 'secret' - assert_no_difference 'Issue.count' do - post :index, :params => { + post( + :index, + :params => { :key => 'secret', :email => IO.read(File.join(FIXTURES_PATH, 'ticket_on_given_project.eml')) } + ) end assert_response 403 assert_include 'Access denied', response.body @@ -111,12 +122,14 @@ class MailHandlerControllerTest < Redmine::ControllerTest def test_should_not_allow_with_wrong_key Setting.mail_handler_api_enabled = 1 Setting.mail_handler_api_key = 'secret' - assert_no_difference 'Issue.count' do - post :index, :params => { + post( + :index, + :params => { :key => 'wrong', :email => IO.read(File.join(FIXTURES_PATH, 'ticket_on_given_project.eml')) } + ) end assert_response 403 assert_include 'Access denied', response.body @@ -125,10 +138,7 @@ class MailHandlerControllerTest < Redmine::ControllerTest def test_new Setting.mail_handler_api_enabled = 1 Setting.mail_handler_api_key = 'secret' - - get :new, :params => { - :key => 'secret' - } + get(:new, :params => {:key => 'secret'}) assert_response :success end end -- 2.39.5