From: Toshi MARUYAMA Date: Sat, 9 Nov 2019 14:09:57 +0000 (+0000) Subject: cleanup: rubocop: fix Layout/AlignArguments in test/integration/api_test/time_entries... X-Git-Tag: 4.1.0~91 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1d7e0d54db62df6d27ad3f9f13f0d7ad0048a269;p=redmine.git cleanup: rubocop: fix Layout/AlignArguments in test/integration/api_test/time_entries_test.rb git-svn-id: http://svn.redmine.org/redmine/trunk@19012 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/test/integration/api_test/time_entries_test.rb b/test/integration/api_test/time_entries_test.rb index df0449417..f42d0ae97 100644 --- a/test/integration/api_test/time_entries_test.rb +++ b/test/integration/api_test/time_entries_test.rb @@ -68,9 +68,13 @@ class Redmine::ApiTest::TimeEntriesTest < Redmine::ApiTest::Base test "POST /time_entries.xml with issue_id should create time entry" do assert_difference 'TimeEntry.count' do - post '/time_entries.xml', - :params => {:time_entry => {:issue_id => '1', :spent_on => '2010-12-02', :hours => '3.5', :activity_id => '11'}}, - :headers => credentials('jsmith') + post( + '/time_entries.xml', + :params => + {:time_entry => + {:issue_id => '1', :spent_on => '2010-12-02', + :hours => '3.5', :activity_id => '11'}}, + :headers => credentials('jsmith')) end assert_response :created assert_equal 'application/xml', @response.content_type @@ -88,11 +92,15 @@ class Redmine::ApiTest::TimeEntriesTest < Redmine::ApiTest::Base field = TimeEntryCustomField.create!(:name => 'Test', :field_format => 'string') assert_difference 'TimeEntry.count' do - post '/time_entries.xml', - :params => {:time_entry => { - :issue_id => '1', :spent_on => '2010-12-02', :hours => '3.5', :activity_id => '11', :custom_fields => [{:id => field.id.to_s, :value => 'accepted'}] + post( + '/time_entries.xml', + :params => + {:time_entry => + {:issue_id => '1', :spent_on => '2010-12-02', + :hours => '3.5', :activity_id => '11', + :custom_fields => [{:id => field.id.to_s, :value => 'accepted'}] }}, - :headers => credentials('jsmith') + :headers => credentials('jsmith')) end assert_response :created assert_equal 'application/xml', @response.content_type @@ -103,9 +111,13 @@ class Redmine::ApiTest::TimeEntriesTest < Redmine::ApiTest::Base test "POST /time_entries.xml with project_id should create time entry" do assert_difference 'TimeEntry.count' do - post '/time_entries.xml', - :params => {:time_entry => {:project_id => '1', :spent_on => '2010-12-02', :hours => '3.5', :activity_id => '11'}}, - :headers => credentials('jsmith') + post( + '/time_entries.xml', + :params => + {:time_entry => + {:project_id => '1', :spent_on => '2010-12-02', + :hours => '3.5', :activity_id => '11'}}, + :headers => credentials('jsmith')) end assert_response :created assert_equal 'application/xml', @response.content_type @@ -121,9 +133,10 @@ class Redmine::ApiTest::TimeEntriesTest < Redmine::ApiTest::Base test "POST /time_entries.xml with invalid parameters should return errors" do assert_no_difference 'TimeEntry.count' do - post '/time_entries.xml', + post( + '/time_entries.xml', :params => {:time_entry => {:project_id => '1', :spent_on => '2010-12-02', :activity_id => '11'}}, - :headers => credentials('jsmith') + :headers => credentials('jsmith')) end assert_response :unprocessable_entity assert_equal 'application/xml', @response.content_type @@ -133,9 +146,10 @@ class Redmine::ApiTest::TimeEntriesTest < Redmine::ApiTest::Base test "PUT /time_entries/:id.xml with valid parameters should update time entry" do assert_no_difference 'TimeEntry.count' do - put '/time_entries/2.xml', + put( + '/time_entries/2.xml', :params => {:time_entry => {:comments => 'API Update'}}, - :headers => credentials('jsmith') + :headers => credentials('jsmith')) end assert_response :no_content assert_equal '', @response.body @@ -144,9 +158,10 @@ class Redmine::ApiTest::TimeEntriesTest < Redmine::ApiTest::Base test "PUT /time_entries/:id.xml with invalid parameters should return errors" do assert_no_difference 'TimeEntry.count' do - put '/time_entries/2.xml', + put( + '/time_entries/2.xml', :params => {:time_entry => {:hours => '', :comments => 'API Update'}}, - :headers => credentials('jsmith') + :headers => credentials('jsmith')) end assert_response :unprocessable_entity assert_equal 'application/xml', @response.content_type @@ -155,10 +170,10 @@ class Redmine::ApiTest::TimeEntriesTest < Redmine::ApiTest::Base end test "PUT /time_entries/:id.xml without permissions should fail" do - put '/time_entries/2.xml', + put( + '/time_entries/2.xml', :params => {:time_entry => {:hours => '2.3', :comments => 'API Update'}}, - :headers => credentials('dlopper') - + :headers => credentials('dlopper')) assert_response 403 end