Sha256: d1a938a94bc764edcfafb228539e6d35a79b12eb606212b1cf10a0c02793afeb

Contents?: true

Size: 507 Bytes

Versions: 6

Compression:

Stored size: 507 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
        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

6 entries across 6 versions & 1 rubygems

Version Path
disco_app-0.8.8 test/support/test_shopify_api.rb
disco_app-0.8.9 test/support/test_shopify_api.rb
disco_app-0.9.0 test/support/test_shopify_api.rb
disco_app-0.9.1 test/support/test_shopify_api.rb
disco_app-0.9.2 test/support/test_shopify_api.rb
disco_app-0.9.3 test/support/test_shopify_api.rb