currency_test.rb 636 B

123456789101112131415161718192021
  1. # frozen_string_literal: true
  2. require 'test_helper'
  3. class CurrencyTest < Test::Unit::TestCase
  4. def setup
  5. super
  6. fake("currencies", method: :get, body: load_fixture('currencies'))
  7. end
  8. context "Currency" do
  9. should 'return a list of enabled currencies' do
  10. currencies = ShopifyAPI::Currency.all
  11. assert_equal(4, currencies.count)
  12. assert_equal(%w(AUD EUR GBP HKD), currencies.map(&:currency))
  13. assert_equal([true, true, true, false], currencies.map(&:enabled))
  14. currencies.each do |currency|
  15. assert_equal("2018-10-03T14:44:08-04:00", currency.rate_updated_at)
  16. end
  17. end
  18. end
  19. end