Ask A Question


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


+1 to this question!




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.


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


I still have the doubt


El Pollo Loco Gluten-Free Menu 2021


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).


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

Join the discussion
Create an account Log in

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

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

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

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

    © 2024 GoRails, LLC. All rights reserved.