[rspec-users] Results in rspec 2.4.0

Mike Mazur mmazur at gmail.com
Wed Jan 12 06:14:06 EST 2011


On Wed, Jan 12, 2011 at 15:45, Amit Kulkarni <lists at ruby-forum.com> wrote:
> When running the script i am getting output as
> User Profile should not be created if name is blank
>     Failure/Error: @contact_detail.should be_valid
>       expected valid? to return true, got false
>     # ./spec/models/merchant_spec.rb:79
> for every failed spec.
> >From the above result it is not clear actually what is the error where
> as in rspec version 1.2.9 we would get like "user_name cannot be blank"

I'm not sure what things were like in 1.2.9 and how well your existing
1.2.9 specs are supported in 2.4.0. Testing for specific errors can be
done like this:

  @contact_detail.should have(1).error_on(:user_name)

See this excellent presentation for more gems:



More information about the rspec-users mailing list