Sha256: 453a57fdfc9bc30b389efde205980903603e551151c8ebaee969fb69cb83714c
Contents?: true
Size: 1.7 KB
Versions: 62
Compression:
Stored size: 1.7 KB
Contents
require 'test_helper' module Workarea class Shipping class LocationQueryTest < TestCase def test_location_services pa_service = create_shipping_service(country: 'US', regions: ['PA']) generic = create_shipping_service methods = [pa_service, generic] location_services = Workarea::Shipping::LocationQuery.new( methods, Country['US'], 'PA' ).location_services refute_includes(location_services.map(&:id), generic.id) assert_includes(location_services.map(&:id), pa_service.id) location_services = Workarea::Shipping::LocationQuery.new( methods, Country['US'], 'CA' ).location_services assert_includes(location_services.map(&:id), generic.id) refute_includes(location_services.map(&:id), pa_service.id) end def test_initialize_with_different_country_types pa_service = create_shipping_service(country: 'US', regions: ['PA']) ca_service = create_shipping_service(country: 'US', regions: ['CA']) services = [pa_service, ca_service] as_string = Workarea::Shipping::LocationQuery.new( services, 'US', 'PA' ).country as_country = Workarea::Shipping::LocationQuery.new( services, Country['US'], 'PA' ).country as_active_utils = Workarea::Shipping::LocationQuery.new( services, ActiveUtils::Country.find('US'), 'PA' ).country assert_equal(Country['US'], as_string) assert_equal(Country['US'], as_country) assert_equal(Country['US'], as_active_utils) end end end end
Version data entries
62 entries across 62 versions & 1 rubygems