Sha256: 2e1b8534242f8a7e06c1c8d02d69f8c439c9c213be2e628abc5a6f0ed3af5e91
Contents?: true
Size: 897 Bytes
Versions: 9
Compression:
Stored size: 897 Bytes
Contents
# frozen_string_literal: true require 'test_helper' class WebhookTest < Test::Unit::TestCase test 'create should create a webhook' do fake('webhooks', method: :post, status: 201, body: load_fixture('webhook')) webhook = ShopifyAPI::Webhook.create( address: "http://www.yoloship.it/webhook", topic: "orders/create", format: "json" ) assert_equal("http://www.yoloship.it/webhook", webhook.address) end test 'get should retrieve a webhook' do fake('webhooks/123456', method: :get, status: 200, body: load_fixture('webhook')) webhook = ShopifyAPI::Webhook.find(123456) assert_equal("http://www.yoloship.it/webhook", webhook.address) end test 'find all should return all webhooks' do fake('webhooks', method: :get, status: 200, body: load_fixture('webhooks')) webhook = ShopifyAPI::Webhook.all assert_equal(123456, webhook.first.id) end end
Version data entries
9 entries across 9 versions & 2 rubygems