Hi,

On Wed, Jan 12, 2011 at 15:45, Amit Kulkarni <li...@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:

  http://kerryb.github.com/iprug-rspec-presentation

Mike
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to