test(support): fix any_instance deprecation warning

Changed from the old syntax to the new allow_any_instance_of according to the documentation.

https://www.rubydoc.info/github/rspec/rspec-mocks/RSpec/Mocks/ExampleMethods%3aallow_any_instance_of
This commit is contained in:
Luis Castro 2019-07-14 11:25:00 +02:00
parent a20bd477ce
commit 33862bab25
No known key found for this signature in database
GPG key ID: 0A8F33D4C4E27639
3 changed files with 5 additions and 5 deletions

View file

@ -5,7 +5,7 @@ describe UpdateTickets do
let(:ticket) {
Event.any_instance.stub(:geocode).and_return([1,1])
allow_any_instance_of(Event).to receive(:geocode).and_return([1,1])
create(:ticket, :has_card, :has_event)
}

View file

@ -17,11 +17,11 @@ RSpec.shared_context :shared_donation_charge_context do
let(:campaign) {force_create(:campaign, nonprofit: nonprofit, goal_amount: 500)}
let(:other_campaign) {force_create(:campaign, nonprofit: other_nonprofit)}
let(:event) {
Event.any_instance.stub(:geocode).and_return([1,1])
allow_any_instance_of(Event).to receive(:geocode).and_return([1,1])
force_create(:event, nonprofit: nonprofit)
}
let(:other_event) {
Event.any_instance.stub(:geocode).and_return([1,1])
allow_any_instance_of(Event).to receive(:geocode).and_return([1,1])
force_create(:event, nonprofit: other_nonprofit)
}
let(:event_discount) {force_create(:event_discount, event: event, percent: 20)}
@ -46,4 +46,4 @@ RSpec.shared_context :shared_donation_charge_context do
StripeMock.stop
end
}
end
end

View file

@ -19,7 +19,7 @@ RSpec.shared_context :shared_rd_donation_value_context do
let(:default_edit_token) {'7903e34c-10fe-11e8-9ead-d302c690bee4'}
before(:each){
allow_any_instance_of(Event).to_receive(:geocode).and_return([1,1])
allow_any_instance_of(Event).to receive(:geocode).and_return([1,1])
}