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
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
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:
>
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
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
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