From 88d90a37e8f8ae1a11b018c1f645ca3cdd38c213 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Tue, 1 Sep 2020 15:53:18 +0100 Subject: [PATCH] Run transpec --- spec/controllers/api/states_controller_spec.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/spec/controllers/api/states_controller_spec.rb b/spec/controllers/api/states_controller_spec.rb index f8372ea3bf..81313c3153 100644 --- a/spec/controllers/api/states_controller_spec.rb +++ b/spec/controllers/api/states_controller_spec.rb @@ -22,25 +22,25 @@ module Api context "pagination" do before do - Spree::State.should_receive(:all).and_return(@scope = double) - @scope.stub_chain(:ransack, :result, :includes, :order).and_return(@scope) + expect(Spree::State).to receive(:all).and_return(@scope = double) + allow(@scope).to receive_message_chain(:ransack, :result, :includes, :order).and_return(@scope) end it "does not paginate states results when asked not to do so" do - @scope.should_not_receive(:page) - @scope.should_not_receive(:per) + expect(@scope).not_to receive(:page) + expect(@scope).not_to receive(:per) api_get :index end it "paginates when page parameter is passed through" do - @scope.should_receive(:page).with(1).and_return(@scope) - @scope.should_receive(:per).with(nil) + expect(@scope).to receive(:page).with(1).and_return(@scope) + expect(@scope).to receive(:per).with(nil) api_get :index, page: 1 end it "paginates when per_page parameter is passed through" do - @scope.should_receive(:page).with(nil).and_return(@scope) - @scope.should_receive(:per).with(25) + expect(@scope).to receive(:page).with(nil).and_return(@scope) + expect(@scope).to receive(:per).with(25) api_get :index, per_page: 25 end end