Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
Adding tests for new monorail metadata setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Anema committed Oct 16, 2020
1 parent b5e347c commit 70f08ef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/shopify-cli/tasks/create_api_client_test.rb
Expand Up @@ -5,6 +5,10 @@ module Tasks
class CreateApiClientTest < MiniTest::Test
include TestHelpers::Partners

def teardown
ShopifyCli::Core::Monorail.metadata = {}
end

def test_call_will_query_partners_dashboard
stub_partner_req(
'create_app',
Expand Down Expand Up @@ -36,6 +40,7 @@ def test_call_will_query_partners_dashboard

refute_nil(api_client)
assert_equal(api_client['apiKey'], 'newapikey')
assert_equal("newapikey", ShopifyCli::Core::Monorail.metadata[:api_key])
end

def test_call_will_return_any_user_errors
Expand Down
5 changes: 5 additions & 0 deletions test/shopify-cli/tasks/select_org_and_shop_test.rb
Expand Up @@ -5,6 +5,10 @@ module Tasks
class SelectOrgAndShopTest < MiniTest::Test
include TestHelpers::Partners

def teardown
ShopifyCli::Core::Monorail.metadata = {}
end

def test_user_will_be_prompted_if_more_than_one_organization
stub_partner_req(
'all_organizations',
Expand Down Expand Up @@ -36,6 +40,7 @@ def test_user_will_be_prompted_if_more_than_one_organization
.with(@context.message('core.tasks.select_org_and_shop.organization_select'))
.returns(431)
form = call(org_id: nil, shop: nil)
assert_equal(431, ShopifyCli::Core::Monorail.metadata[:organization_id])
assert_equal(form[:organization_id], 431)
assert_equal(form[:shop_domain], 'other.myshopify.com')
end
Expand Down

0 comments on commit 70f08ef

Please sign in to comment.