In old RSpec, in a Rails Mountable Engine project with no database
underneath. We have the following expectation set up.
User.should_receive(:find_by_user_id_and_type).with(42,
'GREAT_USER').and_return(user)
The above worked fine.
In rspec 3.2, we changed to
allow(User).to receive(:find_by_user_id_and_type).with(42,
'GREAT_USER').and_return(user)
This now fails with the error:
ActiveRecord::StatementInvalid: Could not find table 'users'
It appears in rspec 3.4 when the expectation is set up, rspec does try to
load the ActiveRecord properties from the database. The old rspec did not
do this. This allowed us to write rspec tests against a Rails Mountable
Engine project without actually having to load and configure a test
database. The database for this project is loaded and available in the main
project which uses this subproject.
Thanks in advance for any help.
Adam
--
You received this message because you are subscribed to the Google Groups
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rspec/68e6bdcf-a228-45c4-bcd8-c12b1e31af1e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.