This is my spec code that isn't working:
require 'spec_helper'
describe User do
describe "blah" do
it "should save itself" do
user = User.make!
u = User.find user.id
user = User.make!
u = User.find user.id
end
end
end
The spec fails on the 2nd User.find even though that user object has an id.
If I remove the 'describe "blah" do' block then the code seems to work fine. I'm using machinist 2.0.0.beta2.
If I disable machinist caching in my test.rb config file it also works:
Machinist.configure do |config|
config.cache_objects = false
end
Anyone know what I'm doing wrong here? Is it a bad practice to nest multiple describes in a spec?
Thanks