From 84a366fbc557b1ee1a0cff15018cf9029f8c2786 Mon Sep 17 00:00:00 2001 From: Elliot Winkler Date: Thu, 22 Jan 2015 18:46:35 -0700 Subject: [PATCH] Fix test that was written poorly --- .../validate_numericality_of_matcher_spec.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/unit/shoulda/matchers/active_model/validate_numericality_of_matcher_spec.rb b/spec/unit/shoulda/matchers/active_model/validate_numericality_of_matcher_spec.rb index 3b98ed8b..f1b5863d 100644 --- a/spec/unit/shoulda/matchers/active_model/validate_numericality_of_matcher_spec.rb +++ b/spec/unit/shoulda/matchers/active_model/validate_numericality_of_matcher_spec.rb @@ -18,11 +18,11 @@ describe Shoulda::Matchers::ActiveModel::ValidateNumericalityOfMatcher, type: :m it 'rejects with the ActiveRecord :not_a_number message' do the_matcher = matcher - - the_matcher.matches?(define_model(:example, attr: :string).new) - - expect(the_matcher.failure_message_when_negated) - .to include 'Did not expect errors to include "is not a number"' + expect do + expect(not_validating_numericality).to the_matcher + end.to fail_with_message_including( + 'Expected errors to include "is not a number"' + ) end it 'rejects with the ActiveRecord :not_an_integer message' do