Sha256: 17fbbec75d309872b3e80182d43a07469ac9b8a6d99b222ecc1cc193109ed84c
Contents?: true
Size: 695 Bytes
Versions: 14
Compression:
Stored size: 695 Bytes
Contents
module RSpec module Rails module Matchers # @private class BeANewRecord < RSpec::Matchers::BuiltIn::BaseMatcher def matches?(actual) !actual.persisted? end def failure_message "expected #{actual.inspect} to be a new record, but was persisted" end def failure_message_when_negated "expected #{actual.inspect} to be persisted, but was a new record" end end # Passes if actual returns `false` for `persisted?`. # # @example # get :new # expect(assigns(:thing)).to be_new_record def be_new_record BeANewRecord.new end end end end
Version data entries
14 entries across 13 versions & 3 rubygems