[rspec-users] be_valid method undefined on model spec

Rick rsalsa at gmail.com
Wed Nov 24 00:32:03 EST 2010

Hi all,

I'm using rspec-rails and have a simple model spec which fails with
the following trace:

undefined local variable or method `be_valid' for #<Class:
0x00000102c6e820> (NameError)

Full trace: https://gist.github.com/713164

The spec is simple:

require 'spec_helper'

describe Deal do

  describe "it should not allow start dates in the past" do
    Deal.new.should be_valid


That above fails. I'm running rspec 2.1.0. Any ideas what could be
wrong? I'm searched the list and unfortunately haven't found anything
similar. Is it that rspec-rails isn't being loaded correctly? All my
controller specs work just fine.


More information about the rspec-users mailing list