We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When a stubbed model is inside a transaction it sometimes generates a difficult to decipher error.
It should give an error like:
RuntimeError: stubbed models are not allowed to access the database - Job#reload() factory_girl-4.5.0/lib/factory_girl/strategy/stub.rb:48:in `reload'
However instead it gives an error:
ArgumentError: wrong number of arguments (1 for 0) factory_girl-4.5.0/lib/factory_girl/strategy/stub.rb:47:in `reload'
This is because the def for reload in stub needs to include a (*args) as reload can be called with the args of the lock.
I could create a pull request for this (it's really easy) but would you welcome a PR without a spec?
The text was updated successfully, but these errors were encountered:
@red56 I'd welcome a PR but please add a spec for it. I'd take a peek at https://github.com/thoughtbot/factory_girl/blob/master/spec/factory_girl/strategy/stub_spec.rb to better understand how it's being tested currently.
Sorry, something went wrong.
correct error message when stubbed reload called with transaction loc…
ee571ca
…k attr. Fixes thoughtbot#719
deaf552
No branches or pull requests
When a stubbed model is inside a transaction it sometimes generates a difficult to decipher error.
It should give an error like:
However instead it gives an error:
This is because the def for reload in stub needs to include a (*args) as reload can be called with the args of the lock.
I could create a pull request for this (it's really easy) but would you welcome a PR without a spec?
The text was updated successfully, but these errors were encountered: