mirror of
https://github.com/redmine/redmine.git
synced 2025-11-15 09:46:02 +01:00
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:
@@ -744,7 +744,7 @@ class ProjectsControllerTest < Redmine::ControllerTest
|
||||
}
|
||||
}
|
||||
)
|
||||
assert_response 302
|
||||
assert_response :found
|
||||
end
|
||||
project = Project.order('id desc').first
|
||||
assert_equal 'inherited', project.name
|
||||
@@ -839,7 +839,7 @@ class ProjectsControllerTest < Redmine::ControllerTest
|
||||
project = Project.find_by_identifier('ecookbook')
|
||||
project.archive
|
||||
get(:show, :params => {:id => 'ecookbook'})
|
||||
assert_response 403
|
||||
assert_response :forbidden
|
||||
assert_select 'p', :text => /archived/
|
||||
assert_not_include project.name, response.body
|
||||
end
|
||||
@@ -849,7 +849,7 @@ class ProjectsControllerTest < Redmine::ControllerTest
|
||||
project = Project.find_by_identifier('ecookbook')
|
||||
project.archive
|
||||
get(:show, :params => {:id => 'ecookbook'})
|
||||
assert_response 403
|
||||
assert_response :forbidden
|
||||
assert_select 'a', :text => "Unarchive"
|
||||
end
|
||||
|
||||
@@ -920,13 +920,13 @@ class ProjectsControllerTest < Redmine::ControllerTest
|
||||
Project.find(1).close
|
||||
@request.session[:user_id] = 2 # manager
|
||||
get(:settings, :params => {:id => 1})
|
||||
assert_response 403
|
||||
assert_response :forbidden
|
||||
end
|
||||
|
||||
def test_settings_should_be_denied_for_anonymous_on_closed_project
|
||||
Project.find(1).close
|
||||
get(:settings, :params => {:id => 1})
|
||||
assert_response 403
|
||||
assert_response :forbidden
|
||||
end
|
||||
|
||||
def test_settings_should_accept_version_status_filter
|
||||
@@ -1015,7 +1015,7 @@ class ProjectsControllerTest < Redmine::ControllerTest
|
||||
role.permissions = []
|
||||
role.save
|
||||
get(:settings, :params => {:id => project.id})
|
||||
assert_response 403
|
||||
assert_response :forbidden
|
||||
|
||||
role.add_permission! :manage_repository, :manage_boards, :manage_project_activities
|
||||
get(:settings, :params => {:id => project.id})
|
||||
@@ -1105,7 +1105,7 @@ class ProjectsControllerTest < Redmine::ControllerTest
|
||||
}
|
||||
}
|
||||
)
|
||||
assert_response 403
|
||||
assert_response :forbidden
|
||||
assert_equal 'eCookbook', Project.find(1).name
|
||||
end
|
||||
|
||||
@@ -1120,7 +1120,7 @@ class ProjectsControllerTest < Redmine::ControllerTest
|
||||
}
|
||||
}
|
||||
)
|
||||
assert_response 403
|
||||
assert_response :forbidden
|
||||
assert_equal 'eCookbook', Project.find(1).name
|
||||
end
|
||||
|
||||
@@ -1138,7 +1138,7 @@ class ProjectsControllerTest < Redmine::ControllerTest
|
||||
}
|
||||
}
|
||||
)
|
||||
assert_response 302
|
||||
assert_response :found
|
||||
assert_match /Successful update/, flash[:notice]
|
||||
end
|
||||
|
||||
@@ -1320,7 +1320,7 @@ class ProjectsControllerTest < Redmine::ControllerTest
|
||||
:confirm => 'ecookbook'
|
||||
}
|
||||
)
|
||||
assert_response 403
|
||||
assert_response :forbidden
|
||||
end
|
||||
assert Project.find(1)
|
||||
end
|
||||
@@ -1328,7 +1328,7 @@ class ProjectsControllerTest < Redmine::ControllerTest
|
||||
def test_bulk_destroy_should_require_admin
|
||||
@request.session[:user_id] = 2 # non-admin
|
||||
delete :bulk_destroy, params: { ids: [1, 2], confirm: 'Yes' }
|
||||
assert_response 403
|
||||
assert_response :forbidden
|
||||
end
|
||||
|
||||
def test_bulk_destroy_should_require_confirmation
|
||||
@@ -1338,7 +1338,7 @@ class ProjectsControllerTest < Redmine::ControllerTest
|
||||
end
|
||||
assert Project.find(1)
|
||||
assert Project.find(2)
|
||||
assert_response 200
|
||||
assert_response :ok
|
||||
end
|
||||
|
||||
def test_bulk_destroy_should_delete_projects
|
||||
@@ -1415,7 +1415,7 @@ class ProjectsControllerTest < Redmine::ControllerTest
|
||||
def test_get_copy_with_invalid_source_should_respond_with_404
|
||||
@request.session[:user_id] = 1
|
||||
get(:copy, :params => {:id => 99})
|
||||
assert_response 404
|
||||
assert_response :not_found
|
||||
end
|
||||
|
||||
def test_get_copy_should_preselect_custom_fields
|
||||
|
||||
Reference in New Issue
Block a user