Gandalf StormCrow
Gandalf StormCrow

Reputation: 26212

Deprecation Warnings rspec 3.3.3

My test seems to be pretty straight forward :

describe MyModel do

  describe 'validations' do
    it { is_expected.to validate_presence_of(:relation_object) }
  end
end

I get this warning:

eprecation Warnings:

--------------------------------------------------------------------------------
Shoulda::Matchers::ActiveModel::ValidatePresenceOfMatcher implements a legacy RSpec matcher
protocol. For the current protocol you should expose the failure messages
via the `failure_message` and `failure_message_when_negated` methods.

What am I doing wrong?

Upvotes: 0

Views: 162

Answers (1)

Myron Marston
Myron Marston

Reputation: 21810

You're not doing any thing wrong. You're just using an old version of shoulda-matchers that implements an older protocol. It looks like shoulda-matchers was updated to address that deprecation warning in 2.5 so if you update shoulda-matchers to 2.5.0 or greater the warning should go away.

Upvotes: 3

Related Questions