Skip to content

Commit

Permalink
Replace expects with stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
zzooeeyy committed Mar 27, 2024
1 parent 6079cf4 commit 5448d55
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/shopify_app/controller_concerns/token_exchange_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class TokenExchangeControllerTest < ActionController::TestCase

test "Exchanges offline token when session doesn't exist" do
with_application_test_routes do
ShopifyAPI::Utils::SessionUtils.expects(:current_session_id).twice.with(
ShopifyAPI::Utils::SessionUtils.stubs(:current_session_id).with(
@session_token_in_header,
nil,
false,
Expand All @@ -74,7 +74,7 @@ class TokenExchangeControllerTest < ActionController::TestCase
ShopifyApp::SessionRepository.user_storage = ShopifyApp::InMemoryUserSessionStore

with_application_test_routes do
ShopifyAPI::Utils::SessionUtils.expects(:current_session_id).twice.with(
ShopifyAPI::Utils::SessionUtils.stubs(:current_session_id).with(
@session_token_in_header,
nil,
true,
Expand Down Expand Up @@ -102,7 +102,7 @@ class TokenExchangeControllerTest < ActionController::TestCase
ShopifyApp::SessionRepository.store_shop_session(@offline_session)

with_application_test_routes do
ShopifyAPI::Utils::SessionUtils.expects(:current_session_id).with(
ShopifyAPI::Utils::SessionUtils.stubs(:current_session_id).with(
@session_token_in_header,
nil,
false,
Expand All @@ -121,7 +121,7 @@ class TokenExchangeControllerTest < ActionController::TestCase
ShopifyApp::SessionRepository.store_user_session(@online_session, @user)

with_application_test_routes do
ShopifyAPI::Utils::SessionUtils.expects(:current_session_id).with(
ShopifyAPI::Utils::SessionUtils.stubs(:current_session_id).with(
@session_token_in_header,
nil,
true,
Expand All @@ -142,7 +142,7 @@ class TokenExchangeControllerTest < ActionController::TestCase
@online_session.stubs(:expired?).returns(true)

with_application_test_routes do
ShopifyAPI::Utils::SessionUtils.expects(:current_session_id).twice.with(
ShopifyAPI::Utils::SessionUtils.stubs(:current_session_id).with(
@session_token_in_header,
nil,
true,
Expand Down Expand Up @@ -176,7 +176,7 @@ class TokenExchangeControllerTest < ActionController::TestCase
@online_session.stubs(:expired?).returns(false)

with_application_test_routes do
ShopifyAPI::Utils::SessionUtils.expects(:current_session_id).with(
ShopifyAPI::Utils::SessionUtils.stubs(:current_session_id).with(
@session_token_in_header,
nil,
true,
Expand Down

0 comments on commit 5448d55

Please sign in to comment.