From 96981b1daf23f8df3027ae9e46ab40c79a30e70a Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Mon, 25 Nov 2019 16:49:07 +0000 Subject: [PATCH] cleanup: rubocop: fix Layout/IndentFirstHashElement in test/functional/issue_statuses_controller_test.rb git-svn-id: http://svn.redmine.org/redmine/trunk@19306 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- .../issue_statuses_controller_test.rb | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/test/functional/issue_statuses_controller_test.rb b/test/functional/issue_statuses_controller_test.rb index 19e6926a0..703ed92e4 100644 --- a/test/functional/issue_statuses_controller_test.rb +++ b/test/functional/issue_statuses_controller_test.rb @@ -68,11 +68,14 @@ class IssueStatusesControllerTest < Redmine::ControllerTest def test_create assert_difference 'IssueStatus.count' do - post :create, :params => { + post( + :create, + :params => { :issue_status => { :name => 'New status' } } + ) end assert_redirected_to :action => 'index' status = IssueStatus.order('id DESC').first @@ -80,42 +83,49 @@ class IssueStatusesControllerTest < Redmine::ControllerTest end def test_create_with_failure - post :create, :params => { + post( + :create, + :params => { :issue_status => { :name => '' } } + ) assert_response :success assert_select_error /name cannot be blank/i end def test_edit - get :edit, :params => { - :id => '3' - } + get(:edit, :params => {:id => '3'}) assert_response :success assert_select 'input[name=?][value=?]', 'issue_status[name]', 'Resolved' end def test_update - put :update, :params => { + put( + :update, + :params => { :id => '3', :issue_status => { :name => 'Renamed status' } } + ) assert_redirected_to :action => 'index' status = IssueStatus.find(3) assert_equal 'Renamed status', status.name end def test_update_with_failure - put :update, :params => { + put( + :update, + :params => { :id => '3', :issue_status => { :name => '' } } + ) assert_response :success assert_select_error /name cannot be blank/i end @@ -123,11 +133,8 @@ class IssueStatusesControllerTest < Redmine::ControllerTest def test_destroy Issue.where(:status_id => 1).delete_all Tracker.where(:default_status_id => 1).delete_all - assert_difference 'IssueStatus.count', -1 do - delete :destroy, :params => { - :id => '1' - } + delete(:destroy, :params => {:id => '1'}) end assert_redirected_to :action => 'index' assert_nil IssueStatus.find_by_id(1) @@ -136,11 +143,8 @@ class IssueStatusesControllerTest < Redmine::ControllerTest def test_destroy_should_block_if_status_is_used_by_issues assert Issue.where(:status_id => 1).any? Tracker.where(:default_status_id => 1).delete_all - assert_no_difference 'IssueStatus.count' do - delete :destroy, :params => { - :id => '1' - } + delete(:destroy, :params => {:id => '1'}) end assert_redirected_to :action => 'index' assert_not_nil IssueStatus.find_by_id(1) @@ -149,11 +153,8 @@ class IssueStatusesControllerTest < Redmine::ControllerTest def test_destroy_should_block_if_status_is_used_as_tracker_default_status Issue.where(:status_id => 1).delete_all assert Tracker.where(:default_status_id => 1).any? - assert_no_difference 'IssueStatus.count' do - delete :destroy, :params => { - :id => '1' - } + delete(:destroy, :params => {:id => '1'}) end assert_redirected_to :action => 'index' assert_not_nil IssueStatus.find_by_id(1) -- 2.39.5