asset_test.rb 765 B

1234567891011121314151617181920212223242526
  1. # frozen_string_literal: true
  2. require 'test_helper'
  3. class AssetTest < Test::Unit::TestCase
  4. def test_get_assetss
  5. fake("themes/1/assets", method: :get, body: load_fixture('assets'))
  6. ShopifyAPI::Asset.find(:all, params: { theme_id: 1 })
  7. end
  8. def test_get_asset_namespaced
  9. fake(
  10. "themes/1/assets.json?asset%5Bkey%5D=templates%2Findex.liquid&theme_id=1",
  11. extension: false,
  12. method: :get,
  13. body: load_fixture('asset')
  14. )
  15. ShopifyAPI::Asset.find('templates/index.liquid', params: { theme_id: 1 })
  16. end
  17. def test_get_asset
  18. fake(
  19. "assets.json?asset%5Bkey%5D=templates%2Findex.liquid", extension: false, method: :get, body: load_fixture('asset')
  20. )
  21. ShopifyAPI::Asset.find('templates/index.liquid')
  22. end
  23. end