debian-mirror-gitlab/spec/support/matchers/nullify_if_blank_matcher.rb
2021-03-11 19:13:27 +05:30

11 lines
312 B
Ruby

# frozen_string_literal: true
RSpec::Matchers.define :nullify_if_blank do |attribute|
match do |record|
expect(record.class.attributes_to_nullify).to include(attribute)
end
failure_message do |record|
"expected nullify_if_blank configuration on #{record.class} to include #{attribute}"
end
end