Written by Sean Behan on Wed Oct 23rd 2013

Rails will infer the controller you want to test from the class name of the test case. For example...

class PeopleControllerTest < ActionController::TestCase
end

will test the app/controllers/people_controller.rb.

To change this is trivial. Use the "test" method inside your test case.

class PeopleControllerImportContactsFromGmailTest < ActionController::TestCase
     tests PeopleController
end

You might want to do this to separate actions in your controller by file in your test suite.


Tagged with..
#Rails #Ruby on Rails #Testing #Functional Tests #Configuration

Just finishing up brewing up some fresh ground comments...