Skip to content

Commit

Permalink
Remove test for ActiveModel::Errors#generate_message
Browse files Browse the repository at this point in the history
  • Loading branch information
vsppedro committed May 15, 2021
1 parent f8c604c commit c7a5747
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions spec/unit/shoulda/matchers/active_model/helpers_spec.rb
Expand Up @@ -78,16 +78,6 @@
end
end
end

context 'if ActiveModel::Errors#generate_message behavior has changed' do
it 'provides the right error message for validate_presence_of' do
stub_active_model_message_generation(
type: :blank,
message: 'Behavior has diverged.',
)
assert_presence_validation_has_correct_message
end
end
end

def assert_presence_validation_has_correct_message
Expand Down Expand Up @@ -150,16 +140,4 @@ def store_translations(options = { without: [] }) # rubocop:disable Metrics/Meth

I18n.backend.store_translations(:en, translations)
end

def stub_active_model_message_generation(options = {})
attribute = options.delete(:attribute) || :attr
message = options.delete(:message)
type = options.delete(:type)

expect_any_instance_of(ActiveModel::Errors).
to receive(:generate_message).
with(attribute, type, {}).
at_least(1).
and_return(message)
end
end

0 comments on commit c7a5747

Please sign in to comment.