Re: [rspec-users] Validations aren't being performed when running 'rspec spec'

2011-02-25 Thread Tom Milewski
Thanks for all of your insight guys. As it turned out the culprit was ".any_instance.stubs(:valid?).returns(false)" which was being run in the controllers. I changed some things around any now everything is working as expected. I was using the following: Rails 3.0.0 RSpec 2.4.0 RSpec Rails 2.4.1

Re: [rspec-users] Validations aren't being performed when running 'rspec spec'

2011-02-24 Thread Craig Demyanovich
On Thu, Feb 24, 2011 at 2:07 PM, Tom Milewski wrote: > Thanks for the replies. > > Here's the error I'm seeing when running all specs (.build > and .create): > > Agent while creating should ensure that name is present > Failure/Error: Factory(:public_agent, :name => nil).should > have(1).erro

Re: [rspec-users] Validations aren't being performed when running 'rspec spec'

2011-02-24 Thread Tom Milewski
I should also note that if I replace ".should have(1).error_on(:name)" with, simply, ".should be_valid". The same issues occur. All specs (except when only running models) pass when they shouldn't be. On Feb 24, 8:48 am, David Chelimsky wrote: > On Feb 23, 2011, at 9:29 AM, Tom Milewski wrote: >

Re: [rspec-users] Validations aren't being performed when running 'rspec spec'

2011-02-24 Thread Tom Milewski
Thanks for the replies. Here's the error I'm seeing when running all specs (.build and .create): Agent while creating should ensure that name is present Failure/Error: Factory(:public_agent, :name => nil).should have(1).error_on(:name) expected 1 error on :name, got 0 # ./spec/mo

Re: [rspec-users] Validations aren't being performed when running 'rspec spec'

2011-02-24 Thread David Chelimsky
On Feb 23, 2011, at 9:29 AM, Tom Milewski wrote: > Hello, > > When I run 'rspec spec/models' everything runs beautifully. > When I run 'rspec spec/controllers' everything also runs beautifully. > When I run 'rspec spec' the models seem to forget that the records > need to pass the validations bef

Re: [rspec-users] Validations aren't being performed when running 'rspec spec'

2011-02-24 Thread Craig Demyanovich
On Wed, Feb 23, 2011 at 10:29 AM, Tom Milewski wrote: > Model: > > validates_presence_of :name, :location, :email... > > Test: > > it "should ensure that name is present" do > Factory.build(:public_agent, :name => nil).should > have(1).error_on(:name) > end > > All of these tests do not retu