Keep in mind that beginners were addicted to writing tests using rspec in rails.
When I tried to test the controller with rspec, I got a lot of errors. No matter where I fixed it, it didn't work, so I decided to write it according to the reference site and investigate what was wrong. But that still doesn't work. .. .. After reviewing the settings, the controller test was deprecated from rails5 and had to be changed as follows.
model → model (as is) controller → request Screen transition test → system
It was necessary to create a folder like this, and it was necessary to describe the rails_helper settings according to the above. Please note that the reference article is a mixture of controller and request.
Also, recent rails have deprecated controller testing, It seems that it was enough if the tests of create, destroy, edit, and update were described.
Recommended Posts