Closed andreasarnol02 closed 8 years ago
validate_presence_of
is a method on the shoulda-matchers gem, this is the shoulda-callback-matchers gem, which only deals with testing callback existence.
No i mean the condition (if or unless) are methods on shoulda matchers callback right? I use shoulda matchers too.
I mean from the (if) or the condition is throwing me that error
Yes, so shoulda-matchers
does not have a chainable if
or unless
, so when you're using shoulda-matchers
test matchers like validate_presence_of
or other validation test matchers, if
and unless
won't be available since shoulda-matchers
does not expose tests for conditions directly.
This gem only exposes the callback
chainable matcher - that means it provides only the matchers you write which begin with
it { is_expected.to callback(:some_method) }
Hi
I tried this code and its not working
It throwed this error "undefined method `if' for Shoulda::Matchers::ActiveModel::AllowValueMatcher:0x00000005d7dd40"
My gem
Is there something wrong with my code?
Thanks!