How to call another message for another controller in Rails Functional Test

I want to make a request to send to another controller inside my functional test, which is designed for a specific controller. However, the post method in the ActiveController class simply calls the method call; it does not accept the controller name to call. Any ideas on how to call another controller?

+6
ruby-on-rails functional-testing
source share
1 answer

When you create tests for controllers using ActiveSupport :: TestCase , you can set which controller to check when you do not want this to be done.

Thus, you can add another class to your test for the current controller, configure the controller for testing in a new class, and implement your test cases.

You did not provide the code, so I can not provide a coded solution, but here is a blog post regarding testing all methods on the controller under RSpec: http://blog.wolfman.com/articles/2007/7/28/rspec-testing-all -actions-of-a-controller

[Personally, I moved away from RSpec / TestUnit for controller tests outside of route validation and fuzzy testing. I prefer integration testing (like Cucumber) for something that involves several parts of the system.]

+4
source share

All Articles