Create a custom has_errors_on RSpec matcher
This commit is contained in:
parent
578ab6e0ef
commit
fc1605e4a0
6
spec/support/matchers/has_errors_on.rb
Normal file
6
spec/support/matchers/has_errors_on.rb
Normal file
@ -0,0 +1,6 @@
|
||||
RSpec::Matchers.define :have_error_on do |expected|
|
||||
match do |actual|
|
||||
expect(actual).to_not be_valid
|
||||
expect(actual.errors.keys).to include expected
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user