Skip to content

Commit

Permalink
Fix rspec-mocks stub deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatack committed Mar 28, 2016
1 parent 4d28609 commit 600892e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion spec/mongoid/adapters/mongoid/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ module Mongoid

context 'with scopes' do
before do
Person.stub :ransackable_scopes => [:active, :over_age]
allow(Person)
.to receive(:ransackable_scopes)
.and_return([:active, :over_age])
end

it "applies true scopes" do
Expand Down
4 changes: 3 additions & 1 deletion spec/ransack/adapters/active_record/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ module ActiveRecord

context 'with scopes' do
before do
Person.stub ransackable_scopes: [:active, :over_age, :of_age]
allow(Person)
.to receive(:ransackable_scopes)
.and_return([:active, :over_age, :of_age])
end

it 'applies true scopes' do
Expand Down

0 comments on commit 600892e

Please sign in to comment.