access_scope_test.rb 716 B

1234567891011121314151617181920212223
  1. # frozen_string_literal: true
  2. require 'test_helper'
  3. class AccessScopeTest < Test::Unit::TestCase
  4. test 'access scope does not use the versioned resource urls' do
  5. fake(
  6. 'access_scopes',
  7. url: 'https://shop2.myshopify.com/admin/oauth/access_scopes.json',
  8. method: :get,
  9. status: 201,
  10. body: load_fixture('access_scopes'),
  11. extension: false
  12. )
  13. unstable_version = ShopifyAPI::Session.new(domain: 'shop2.myshopify.com', token: 'token2', api_version: :unstable)
  14. ShopifyAPI::Base.activate_session(unstable_version)
  15. scope_handles = ShopifyAPI::AccessScope.find(:all).map(&:handle)
  16. assert_equal(['write_product_listings', 'read_shipping'], scope_handles)
  17. end
  18. end