Kasugaijin's open-source Ruby on Rails production app that enables dog rescue organisation staff in Mexico to post dogs and receive applications for adoption from users in USA and Canada..
27
stars
9
forks
source link
Intermittent Test Issue in Adopter Profile Form Integration Test #53
After successfully cloning & initializing the db/seeds,
I was getting errors on the default test suite (without having made any modifications whatsoever).
The error:
undefined method `adopter_account' for nil:NilClass (NoMethodError)
it pointed to line 5 within test/integration/adopter_profile_form_test.rb
which contains:
I even checked the database (in the console), and I could still see the User in your fixtures.
However, after running the tests a few more times, the issue was gone.
Proposed solution: Use the setup method with an instance variable that references the stored fixture. I believe this would be more reliable than using the local variable within the test class. Please let me know if you have other ideas!
After successfully cloning & initializing the db/seeds, I was getting errors on the default test suite (without having made any modifications whatsoever).
The error:
it pointed to line 5 within
test/integration/adopter_profile_form_test.rb
which contains:I even checked the database (in the console), and I could still see the User in your fixtures. However, after running the tests a few more times, the issue was gone.
Proposed solution: Use the
setup
method with an instance variable that references the stored fixture. I believe this would be more reliable than using the local variable within the test class. Please let me know if you have other ideas!Related PR: #52