Skip to content
New issue

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

Instructions not explicit #12

Open
ahnbizcad opened this issue Mar 15, 2015 · 3 comments
Open

Instructions not explicit #12

ahnbizcad opened this issue Mar 15, 2015 · 3 comments

Comments

@ahnbizcad
Copy link

"If you are using rspec-rails and have followed the installation instructions there, you're all set to use stub_model and mock_model."

It seems following those instructions in rpsec-rails does not enable these two methods. It seems you need to explicitly include this gem. I've been getting undefined method 'mock_model' in my test reports until I included this gem in my gemfile.

But nowhere in rspec-rails documentation, nor in this gem's documentation, nor here https://www.relishapp.com/rspec/rspec-rails/docs/upgrade#extract-stub-model does it explicitly say to include this gem. The hazy, somewhat misleading, and implicit documentation should be changed in favor of letting the user know explicitly that this gem must be manually included.

"gem install 'rspec-activemodel-rails'"

or

"You need to install this gem as well as rspec-rails."

@JonRowe
Copy link
Member

JonRowe commented Sep 9, 2015

Would you like to update the documentation? Something along the lines of adding the gem into the gem file and either auto requiring it via bundler or requiring it manually.

@nwittstruck
Copy link
Contributor

This sentence seems to be wrong as well:
To use stub_model and mock_model without rspec-rails, require the following file:
I had to explicitly require 'rspec/active_model/mocks'

I am happy to fix the docs, unless this is actually a bug in rspec-rails?

@JonRowe
Copy link
Member

JonRowe commented Oct 21, 2015

It's not a bug in rspec-rails I believe the documentation is just wrong for rspec-rails 3.x

JonRowe added a commit that referenced this issue Dec 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants