I have dozens of controller tests that go to the tune:
test "GET #show when not authenticated" do
get :show, { id: 1 }
assert_redirected_to '/login'
end
But mine application_controlleris locked by default.
class ApplicationController < ActionController::Base
before_action :ensure_logged_in
end
I do not need to add this test to each controller test. But I do not want to check only one controller.
How can I verify that my application is blocked without clogging my tests with this repetition?
source
share