gift_card_test.rb 509 B

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