Created
September 17, 2013 16:39
-
-
Save wndxlori/6596954 to your computer and use it in GitHub Desktop.
Weird RSpec model failure during my Rails 4 upgrade. Ideas?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def process! | |
self.transaction do | |
foo | |
bar | |
baz | |
boom | |
end | |
end | |
foo creates and populates part of obja (of class Content) and obja.save! | |
bar does obja.build_objb and objb.save! | |
baz updates more obja attributes and obja.save! | |
boom updates more obja attributes, and obja.save! fails on a validation error | |
And the failing spec... | |
it "does not create new Content" do | |
expect { request.process! }.to_not change(Content, :count) | |
end | |
wtf. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oh, and this is Postgres... could it be some kind of nested transaction problem?