api_version_test.rb 971 B

1234567891011121314151617181920212223242526272829303132
  1. # frozen_string_literal: true
  2. require 'test_helper'
  3. class ApiVersionTest < Test::Unit::TestCase
  4. test "no version creates url that start with /admin/" do
  5. assert_equal(
  6. "/admin/resource_path/id.json",
  7. ShopifyAPI::ApiVersion.no_version.construct_api_path("resource_path/id.json")
  8. )
  9. end
  10. test "no version creates graphql url that start with /admin/api" do
  11. assert_equal(
  12. "/admin/api/graphql.json",
  13. ShopifyAPI::ApiVersion.no_version.construct_graphql_path
  14. )
  15. end
  16. test "unstable version creates url that start with /admin/api/unstable/" do
  17. assert_equal(
  18. "/admin/api/unstable/resource_path/id.json",
  19. ShopifyAPI::ApiVersion.unstable.construct_api_path("resource_path/id.json")
  20. )
  21. end
  22. test "unstable version creates graphql url that start with /admin/api/unstable/" do
  23. assert_equal(
  24. "/admin/api/unstable/graphql.json",
  25. ShopifyAPI::ApiVersion.unstable.construct_graphql_path
  26. )
  27. end
  28. end