Sha256: 4f3be935e28e2832b9887d15503c78c5ed3e1afc3cda1719bf338ff9a4666aab
Contents?: true
Size: 772 Bytes
Versions: 9
Compression:
Stored size: 772 Bytes
Contents
if defined?(ActiveRecord::Base) module Spec module Rails module Matchers # :call-seq: # response.should be_valid # response.should_not be_valid def be_valid ::Spec::Matchers::Matcher.new :be_valid do match do |actual| actual.valid? end failure_message_for_should do |actual| if actual.respond_to?(:errors) && ActiveRecord::Errors === actual.errors "Expected #{actual.inspect} to be valid, but it was not\nErrors: " + actual.errors.full_messages.join(", ") else "Expected #{actual.inspect} to be valid" end end end end end end end end
Version data entries
9 entries across 9 versions & 4 rubygems