Ask A Question

Notifications

You’re not receiving notifications from this thread.

How to write Controller & Integration Tests in Rails Discussion

Hi Chris great job! What is the difference of the integration test with the controller test

Reply

+1 to this question!

Reply

+1

Reply

If you check the previous video "How to use Devise Test Helpers" from about the 8min40s mark, he explains that they are the same thing, but since Rails 5 are referred to as Integration Tests.

Reply

As Menno mentioned, the ControllerTest is now obsolete, rails is using IntegrationTest

Reply

I still have the doubt

Reply

El Pollo Loco Gluten-Free Menu 2021

Reply

If you find that updating with invalid credentials provides a 422 response, instead of the 200 response shown in the video, I think this is okay.
Check the projects_controller.rb, the 422 status is specified in the update action. I think its just an update to the jumpstart framework since the video was recorded. You should specify the error code in your test to match the controller specs as well, assert_response(422).

Reply

This is also a fantastic example of brittle code in action :D

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 85,376+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.