mirror of https://github.com/mastodon/mastodon
Remove unused `model_have_error_on_field` matcher (#33273)
parent
e0a49af47d
commit
4bf6af3b61
@ -1,15 +0,0 @@
|
|||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
RSpec::Matchers.define :model_have_error_on_field do |expected|
|
|
||||||
match do |record|
|
|
||||||
record.valid? if record.errors.empty?
|
|
||||||
|
|
||||||
record.errors.key?(expected)
|
|
||||||
end
|
|
||||||
|
|
||||||
failure_message do |record|
|
|
||||||
keys = record.errors.attribute_names
|
|
||||||
|
|
||||||
"expect record.errors(#{keys}) to include #{expected}"
|
|
||||||
end
|
|
||||||
end
|
|
Loading…
Reference in New Issue