On one Rspec test (which works fine), I have a deprecation warning
Using
stub
from rspec-mocks' old:should
syntax without explicitly enabling the syntax is deprecated. Use the new:expect
syntax or explicitly enable:should
instead.
How should I change this test to be compliant with Rspec 3?
I am testing that the field company name exists/is not empty, then I have to validate presence of the company phone number field. I used to use 'stub' but it does not work properly and I'd like to move to the new Rspec 3 way.
/spec/models/company_spec.rb
describe "test on company name" do
context "test" do
before { subject.stub(:company_name?) { true } }
it { is_expected.to validate_presence_of(:company_phone_number) }
end
end