How to test helpers in Rails with Devise current_user and ActionView::TestCase Discussion
Update: Rubocop recommend to use (Style/TrivialAccessors: Use attr_reader to define trivial reader methods.)
@Chris, I was trying to go through an old version of Rail Tutorial (probably Rails 4) and ran into a similar issue, while creating the authentication system it seems like you said here, we need to define the current_user, logged_in? and other methods again for the tests to work. I finally however, gave up when I realized that I got the error below. It seems counter intuitive though that methods (even helper_methods) defined in the controller cannot be accessed by the TestController, is there any specific reason why this was done?
Minitest::UnexpectedError: NoMethodError: undefined method `session' for nil:NilClass
This is due the usage of session[user_id] in the current_user method which I did include in the ControllerTest