gitlab-org--gitlab-foss/spec/support/matchers/nullify_if_blank_matcher.rb

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