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
Hello
I just installed mongoid-spec 1.2.1 alongside mongoid 2.0.0.beta.17 and Rails 3.0.0. I have the following model spec:
require 'spec_helper' describe Article do it { should have_field(:headword) } end
article.rb:
class Article include Mongoid::Document field :headword end
When I run the spec, I get the following error:
Failures: 1) Article Failure/Error: it { should have_field(:headword) } undefined method `has_field?' for #<Article:0x102bc6008> # /Users/martin/.rvm/gems/ruby-1.8.7-p302/gems/mongoid-2.0.0.beta.17/lib/mongoid/attributes.rb:23:in `method_missing' # ./spec/models/article_spec.rb:5 # /Users/martin/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `inject'
Any idea what could be causing this?
Best regards, Martin Solli
The text was updated successfully, but these errors were encountered:
Did you include the Mongoid::Matchers in spec_helper.rb within the RSpec config block?
RSpec.configure do |config| config.include Mongoid::Matchers end
Sorry, something went wrong.
That did the trick, thanks! It should probably be documented in the readme, for RSpec noobs like me.
Yeah adding this to the docs would be handy
No branches or pull requests
Hello
I just installed mongoid-spec 1.2.1 alongside mongoid 2.0.0.beta.17 and Rails 3.0.0. I have the following model spec:
article.rb:
When I run the spec, I get the following error:
Any idea what could be causing this?
Best regards,
Martin Solli
The text was updated successfully, but these errors were encountered: