diff --git a/lib/jsonapi/resources/matchers/have_attribute.rb b/lib/jsonapi/resources/matchers/have_attribute.rb index 986a854..3b855f9 100644 --- a/lib/jsonapi/resources/matchers/have_attribute.rb +++ b/lib/jsonapi/resources/matchers/have_attribute.rb @@ -28,11 +28,15 @@ def failure_message resource_name = resource.class.name.demodulize %Q(expected #{resource_name} to have attribute #{name}) end + + def failure_message_when_negated + resource_name = resource.class.name.demodulize + %Q(expected #{resource_name} to not have attribute #{name}, but it was present) + end def description "have attribute #{name}" end - end end end