I keep getting
@controller is nil: make sure you set it in your test's setup method.
When I run my tests. Any idea what this means?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
when you inherit from ActionController::TestCase it infers the controller name from the test name if they do not match you have to use the
setuppart of test to set it.So if you have
Then
@controlleris auto instantiated toPostsController, however, if this were not the case and you had a different name you would need asetupas such