Skip to content

Commit 600892e

Browse files
committed
Fix rspec-mocks stub deprecation warnings
1 parent 4d28609 commit 600892e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

spec/mongoid/adapters/mongoid/base_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ module Mongoid
2020

2121
context 'with scopes' do
2222
before do
23-
Person.stub :ransackable_scopes => [:active, :over_age]
23+
allow(Person)
24+
.to receive(:ransackable_scopes)
25+
.and_return([:active, :over_age])
2426
end
2527

2628
it "applies true scopes" do

spec/ransack/adapters/active_record/base_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ module ActiveRecord
2020

2121
context 'with scopes' do
2222
before do
23-
Person.stub ransackable_scopes: [:active, :over_age, :of_age]
23+
allow(Person)
24+
.to receive(:ransackable_scopes)
25+
.and_return([:active, :over_age, :of_age])
2426
end
2527

2628
it 'applies true scopes' do

0 commit comments

Comments
 (0)