[rspec-users] rspec2 not working with shoulda

Nadal node.js99 at gmail.com
Wed Aug 11 03:31:52 EDT 2010

I am using rails edge. I am using gem "rspec-rails", "= 2.0.0.beta.
19" .

I have following code at spec/models/user_spec.rb

require 'spec_helper'

describe User do

  it { should validate_presence_of(:email) }

  it { should validate_presence_of(:name) }


Here is my gemfile

group :development, :test do
  gem 'factory_girl_rails', :git => 'git://github.com/thoughtbot/
  gem 'shoulda'
  gem "rspec-rails", "= 2.0.0.beta.19"
  gem "cucumber-rails", "= 0.3.2"
  gem "capybara"
  gem "launchy"

I am getting following error message.

Failure/Error: it { should validate_presence_of(:email) }
    undefined method `validate_presence_of' for
#<RSpec::Core::ExampleGroup::Nested_2:0x10a63e3a8 @__memoized={}>
    # ./spec/models/user_spec.rb:5

More information about the rspec-users mailing list