Sha256: 3f6d9aa9fa3fce0db074d966c3341411c1073951ccbce6861c27b79a72794147

Contents?: true

Size: 702 Bytes

Versions: 24

Compression:

Stored size: 702 Bytes

Contents

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

24 entries across 24 versions & 1 rubygems

Version Path
shopify_api-9.2.0 test/location_test.rb
shopify_api-9.1.0 test/location_test.rb
shopify_api-9.0.4 test/location_test.rb
shopify_api-9.0.3 test/location_test.rb
shopify_api-9.0.2 test/location_test.rb
shopify_api-9.0.1 test/location_test.rb
shopify_api-9.0.0 test/location_test.rb
shopify_api-8.1.0 test/location_test.rb
shopify_api-8.0.0 test/location_test.rb
shopify_api-7.1.0 test/location_test.rb
shopify_api-7.0.2 test/location_test.rb
shopify_api-7.0.1 test/location_test.rb
shopify_api-7.0.0 test/location_test.rb
shopify_api-6.0.0 test/location_test.rb
shopify_api-5.2.4 test/location_test.rb
shopify_api-5.2.3 test/location_test.rb
shopify_api-5.2.2 test/location_test.rb
shopify_api-5.2.1 test/location_test.rb
shopify_api-5.2.0 test/location_test.rb
shopify_api-5.1.0 test/location_test.rb