Fix RuboCop offense Rails/HttpStatus (#39889).

git-svn-id: https://svn.redmine.org/redmine/trunk@22837 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2024-05-18 05:56:55 +00:00
parent 58e9cd420a
commit a9518e28b8
83 changed files with 376 additions and 398 deletions

View File

@@ -86,7 +86,7 @@ class TimelogControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 3
get :new
assert_response 403
assert_response :forbidden
end
def test_new_should_select_default_role_activity
@@ -504,7 +504,7 @@ class TimelogControllerTest < Redmine::ControllerTest
:hours => '7.3'
}
}
assert_response 403
assert_response :forbidden
end
def test_create_without_project_and_issue_should_fail
@@ -582,7 +582,7 @@ class TimelogControllerTest < Redmine::ControllerTest
}
end
assert_response 403
assert_response :forbidden
end
def test_create_without_project_with_failure
@@ -636,7 +636,7 @@ class TimelogControllerTest < Redmine::ControllerTest
:issue_id => '5'
}
}
assert_response 302
assert_response :found
entry.reload
assert_equal 5, entry.issue_id
@@ -668,7 +668,7 @@ class TimelogControllerTest < Redmine::ControllerTest
:project_id => '2'
}
}
assert_response 302
assert_response :found
entry.reload
assert_equal 2, entry.project_id
@@ -802,7 +802,7 @@ class TimelogControllerTest < Redmine::ControllerTest
# update time entry activity
post :bulk_update, :params => {:ids => [1, 2], :time_entry => {:activity_id => 9}}
assert_response 302
assert_response :found
# check that the issues were updated
assert_equal [9, 9], TimeEntry.where(:id => [1, 2]).collect {|i| i.activity_id}
end
@@ -823,7 +823,7 @@ class TimelogControllerTest < Redmine::ControllerTest
# update time entry activity
post :bulk_update, :params => {:ids => [1, 2, 4], :time_entry => {:activity_id => 9}}
assert_response 302
assert_response :found
# check that the issues were updated
assert_equal [9, 9, 9], TimeEntry.where(:id => [1, 2, 4]).collect {|i| i.activity_id}
end
@@ -836,7 +836,7 @@ class TimelogControllerTest < Redmine::ControllerTest
assert ! user.allowed_to?(action, TimeEntry.find(5).project)
post :bulk_update, :params => {:ids => [1, 5], :time_entry => {:activity_id => 9}}
assert_response 403
assert_response :forbidden
end
def test_bulk_update_with_edit_own_time_entries_permission
@@ -846,7 +846,7 @@ class TimelogControllerTest < Redmine::ControllerTest
ids = (0..1).map {TimeEntry.generate!(:user => User.find(2)).id}
post :bulk_update, :params => {:ids => ids, :time_entry => {:activity_id => 9}}
assert_response 302
assert_response :found
end
def test_bulk_update_with_edit_own_time_entries_permissions_should_be_denied_for_time_entries_of_other_user
@@ -855,7 +855,7 @@ class TimelogControllerTest < Redmine::ControllerTest
Role.find_by_name('Manager').add_permission! :edit_own_time_entries
post :bulk_update, :params => {:ids => [1, 2], :time_entry => {:activity_id => 9}}
assert_response 403
assert_response :forbidden
end
def test_bulk_update_custom_field
@@ -867,7 +867,7 @@ class TimelogControllerTest < Redmine::ControllerTest
:time_entry => {:custom_field_values => {'10' => '0'}}
}
)
assert_response 302
assert_response :found
assert_equal ["0", "0"], TimeEntry.where(:id => [1, 2]).collect {|i| i.custom_value_for(10).value}
end
@@ -881,7 +881,7 @@ class TimelogControllerTest < Redmine::ControllerTest
:time_entry => {:custom_field_values => {field.id.to_s => '__none__'}}
}
)
assert_response 302
assert_response :found
assert_equal ["", ""], TimeEntry.where(:id => [1, 2]).collect {|i| i.custom_value_for(field).value}
end
@@ -906,7 +906,7 @@ class TimelogControllerTest < Redmine::ControllerTest
Role.find_by_name('Manager').remove_permission! :edit_time_entries
post :bulk_update, :params => {:ids => [1, 2]}
assert_response 403
assert_response :forbidden
end
def test_destroy