I made some progress due to the error related to the test code I posted the other day, so I will record it.
Posted the other day ↓ "I'm writing test code using RSpec, but it doesn't work"
Hypothesis 2 turned out to be probably irrelevant.
Helper method
Changing from number_field
to text_field
did not help solve the problem. Since it still cannot be saved well, it is considered that an error has occurred in the part related to the foreign key of Hypothesis 1.
By validating that it is a foreign key in the model, it is possible that the primary key cannot be found by simply entering the ID.
We will continue to verify that the test code works.
Recommended Posts