|
@@ -19,13 +19,23 @@ class SessionTest < Test::Unit::TestCase
|
|
|
end
|
|
|
|
|
|
test "not be valid without an api version" do
|
|
|
- session = ShopifyAPI::Session.new(domain: "testshop.myshopify.com", token: "any-token", api_version: nil)
|
|
|
- assert_not session.valid?
|
|
|
-
|
|
|
session = ShopifyAPI::Session.new(domain: "testshop.myshopify.com", token: "any-token", api_version: ShopifyAPI::ApiVersion::NullVersion)
|
|
|
assert_not session.valid?
|
|
|
end
|
|
|
|
|
|
+ test "default to base api version" do
|
|
|
+ session = ShopifyAPI::Session.new(domain: "testshop.myshopify.com", token: "any-token", api_version: nil)
|
|
|
+ assert session.valid?
|
|
|
+ assert_equal session.api_version, ShopifyAPI::Base.api_version
|
|
|
+ end
|
|
|
+
|
|
|
+ test "can override the base api version" do
|
|
|
+ different_api_version = '2020-01'
|
|
|
+ session = ShopifyAPI::Session.new(domain: "testshop.myshopify.com", token: "any-token", api_version: different_api_version)
|
|
|
+ assert session.valid?
|
|
|
+ assert_equal session.api_version, ShopifyAPI::ApiVersion.find_version(different_api_version)
|
|
|
+ end
|
|
|
+
|
|
|
test "be valid with any token, any url and version" do
|
|
|
session = ShopifyAPI::Session.new(
|
|
|
domain: "testshop.myshopify.com",
|