Open nicolalorusso opened 6 years ago
Nice, I found the source of the issue.
Rails, delete the table each time it loads the fixture.
So the issue is related to the order (alphabetical by default) in which the fixtures are loaded.
In my case rule_products.yml
is loaded before rules.yml
and this end up with a complete delete of all "rules" when the second (the base one) is loaded.
So, we have to figure out how to force the fixtures order
Hi guys, I have an issue with test fixture. The fixture related to extended model is not loaded into the test DB.
My environment: OSX, Rails 5.1.4, Ruby 2.4.2, active_record-mti 0.3.0.pre.rc4
My code (extract) Migrations:
Models:
Fixtures:
Now in the test, if I use:
all works fine, but, if I use:
I got the following error:
and, if I check the test DB, the related table is empty.
I'm doing something wrong? Thanks for the help. Best Regards, Nicola