[rspec-users] Trying to write a failing test-- but am failing!
dchelimsky at gmail.com
Tue Feb 16 21:50:20 EST 2010
On Tue, Feb 16, 2010 at 8:27 PM, patrick99e99 <patrick99e99 at gmail.com> wrote:
> Hi again,
>> user = User.create(@invalid_attributes)
>> user.should_not be_valid
> This gives me:
> NoMethodError in 'User should fail when passwords do not match'
> undefined method `handling_predicate!' for #<Spec::Matchers::Be:
> 0x104d8a518 @args=[:be_valid]>
This suggests that you're mixing versions of rspec and rspec-rails
that are incompatible. What versions are you using, and do you have
any installed in vendor/plugins in addition to vendor/gems?
>> Try raise_error instead of raise_exception. If that works, you're
>> using an older version of rspec. If not, I'm not sure what's going on.
> Yeah, I wasn't carefully reading that error-- it was:
> ActiveRecord::RecordInvalid in 'User should create a valid user'
> I accidentally had @invalid = @valid.merge!(..new password..), and
> that was breaking the should be valid test, the invalid one works with
> the expect block. So that way works... Thank you.
More information about the rspec-users