diff --git a/spec/support/matchers/has_errors_on.rb b/spec/support/matchers/has_errors_on.rb new file mode 100644 index 0000000..fc00050 --- /dev/null +++ b/spec/support/matchers/has_errors_on.rb @@ -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