Create a custom has_errors_on RSpec matcher

This commit is contained in:
Petko Bordjukov 2014-08-07 14:03:28 +03:00
parent 578ab6e0ef
commit fc1605e4a0
1 changed files with 6 additions and 0 deletions

View 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