Dynamoid
Dynamoid copied to clipboard
Model reload method should not silently fail to reload
In my tests, trying to modify a model then reload it to see if the modification method worked, I tried
it "updates the event" do
controller.book_plan(message)
event_reload = Event.find(event.id).reload
event_reload.event_plan_id.should == new_plan.id
end
However it didn't work until I added
it "updates the event" do
controller.book_plan(message)
Dynamoid::IdentityMap.clear
event_reload = Event.find(event.id).reload
event_reload.event_plan_id.should == new_plan.id
end
I can't explain what's going on because I see there are rspec tests to make sure that reload works. Perhaps it's because in my setup caching is enabled ( config.identity_map = true) -- I don't see that toggled in the spec that tests reload in Dynamoid.