gift_card_test.rb 540 B

123456789101112131415161718192021222324
  1. # frozen_string_literal: true
  2. require 'test_helper'
  3. class GiftCardTest < Test::Unit::TestCase
  4. def setup
  5. super
  6. load_gift_card
  7. end
  8. def test_disable
  9. fake('gift_cards/1023670/disable.json', body: load_fixture('gift_card_disabled'), method: :post, extension: false)
  10. refute(@gift_card.disabled_at)
  11. @gift_card.disable
  12. assert(@gift_card.disabled_at)
  13. end
  14. private
  15. def load_gift_card
  16. fake('gift_cards/1023670', body: load_fixture('gift_card'))
  17. @gift_card = ShopifyAPI::GiftCard.find(1023670)
  18. end
  19. end