Sha256: 5e4b844aea4cfddde5e9c3c443fbb622f67e6b6d8e86163ebe6f6e2b93317de3

Contents?: true

Size: 733 Bytes

Versions: 8

Compression:

Stored size: 733 Bytes

Contents

# frozen_string_literal: true
require 'test_helper'

class LocationTest < Test::Unit::TestCase
  test '#inventory_levels returns all inventory_levels associated with this location' do
    location = ShopifyAPI::Location.new(id: 487838322)
    expected_body = JSON.parse(load_fixture('inventory_levels'))
    expected_body['inventory_levels'].delete_if { |level| level['location_id'] != location.id }
    fake "locations/#{location.id}/inventory_levels", method: :get, status: 200, body: JSON(expected_body).to_s
    inventory_levels = location.inventory_levels

    assert inventory_levels.all? { |item| item.location_id == location.id },
           message: 'Response contained locations other than the current location.'
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
ruby_shopify_api-1.2.0 test/location_test.rb
ruby_shopify_api-1.1.0 test/location_test.rb
ruby_shopify_api-1.0.0 test/location_test.rb
shopify_api-9.5.1 test/location_test.rb
shopify_api-9.5 test/location_test.rb
shopify_api-9.4.1 test/location_test.rb
shopify_api-9.4.0 test/location_test.rb
shopify_api-9.3.0 test/location_test.rb