Sha256: e17d78feaee8bf6d5927fc8622e86b297520b3f835feda88647d9b1bd51fba73

Contents?: true

Size: 529 Bytes

Versions: 7

Compression:

Stored size: 529 Bytes

Contents

module DiscoApp::Test
  module ShopifyAPI

    def stub_api_request(method, endpoint, fixture_name)
      if method == :get
        stub_request(method, endpoint)
          .to_return(status: 200, body: api_fixture("#{fixture_name}_response").to_json)
      elsif (method == :post) || (method == :put)
        stub_request(method, endpoint)
          .with(body: api_fixture("#{fixture_name}_request").to_json)
          .to_return(status: 201, body: api_fixture("#{fixture_name}_response").to_json)
      end
    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
disco_app-0.17.0 test/support/test_shopify_api.rb
disco_app-0.18.0 test/support/test_shopify_api.rb
disco_app-0.18.2 test/support/test_shopify_api.rb
disco_app-0.18.3 test/support/test_shopify_api.rb
disco_app-0.18.6 test/support/test_shopify_api.rb
disco_app-0.18.4 test/support/test_shopify_api.rb
disco_app-0.18.1 test/support/test_shopify_api.rb