meta_test.rb 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # frozen_string_literal: true
  2. require 'test_helper'
  3. class ApiVersionTest < Test::Unit::TestCase
  4. test ".admin_versions returns array of api versions for admin" do
  5. versions = [
  6. {
  7. "handle": "2019-01",
  8. "display_name": "2019-01",
  9. "supported": true,
  10. "latest_supported": false,
  11. },
  12. {
  13. "handle": "2019-04",
  14. "latest_supported": false,
  15. "display_name": "2019-04",
  16. "supported": true,
  17. },
  18. {
  19. "handle": "2019-07",
  20. "latest_supported": false,
  21. "display_name": "2019-07",
  22. "supported": true,
  23. },
  24. {
  25. "handle": "2019-10",
  26. "latest_supported": false,
  27. "display_name": "2019-10",
  28. "supported": true,
  29. },
  30. {
  31. "handle": "2020-01",
  32. "latest_supported": true,
  33. "display_name": "2020-01 (Latest)",
  34. "supported": true,
  35. },
  36. {
  37. "handle": "unstable",
  38. "latest_supported": false,
  39. "display_name": "unstable",
  40. "supported": false,
  41. },
  42. ].to_json
  43. assert_equal versions, ShopifyAPI::Meta.admin_versions.to_json
  44. end
  45. end