foxy fixtures – too fast
13Dec07
This one looks like a bug!
# sellers.yml
shopify:
name: Shopify
# products.yml
pimp_cup:
seller: shopifi #what if we make a typo here?
name: Pimp cup
#foxy_test.rb
products(:pimp_cup).nil?
=> false #fixtures are loaded without problems!
products(:pimp_cup).seller.nil?
=> true #huh seller is not set
products(:pimp_cup).seller_id.nil?
=> false #this is totally wrong
sellers(:shopifi)
=> StandardError: No fixture with name 'shopifi' found for table 'sellers' #I'd prefer it at the fixtures loading time
I just made such a typo, which made me stare to my tests for a while..
Update:
It appears that this lack of checking comes for a reason – basically database foreign key constraints are switched off when fixtures are loaded – to be able to use things like ‘fixtures :all’, a very lovely feature. And this lack of checking seems to be not a big deal after conversion to foxy fixtures is completed – during normal dev cycle problems are seen as they come, mainly one by one.
Filed under: fixtures, rails | Leave a Comment
Search
-
You are currently browsing the Artem Vasiliev's Weblog weblog archives.
No Responses Yet to “foxy fixtures – too fast”