Sha256: b22bf5f7ff4ab2fe98eabf7d846e4ecbb4e309b2f0112ba59caaedf50d1fe0fb

Contents?: true

Size: 1.68 KB

Versions: 2

Compression:

Stored size: 1.68 KB

Contents

module FakeShopify
  class StubApp < Sinatra::Base
    #  Event API Endpoints
    get "/admin/api/:api_version/events.json" do
      json_response 200, fixture(params[:api_version], "events/events/index")
    end
    # Retrieves a list of events
    get "/admin/api/:api_version/events/count.json" do
      json_response 200, fixture(params[:api_version], "events/events/count")
    end
    # Retrieves a count of events
    get "/admin/api/:api_version/events/:event_id.json" do
      json_response 200, fixture(params[:api_version], "events/events/show")
    end
    # Retrieves a single event

    # Webhook API Endpoints
    get "/admin/api/:api_version/webhooks.json" do
      json_response 200, fixture(params[:api_version], "events/webhooks/index")
    end
    # Receive a list of all Webhooks
    get "/admin/api/:api_version/webhooks/count.json" do
      json_response 200, fixture(params[:api_version], "events/webhooks/count")
    end
    # Receive a count of all Webhooks
    get "/admin/api/:api_version/webhooks/:webhook_id.json" do
      json_response 200, fixture(params[:api_version], "events/webhooks/show")
    end
    # Receive a single Webhook
    post "/admin/api/:api_version/webhooks.json" do
      json_response 200, fixture(params[:api_version], "events/webhooks/create")
    end
    # Create a new Webhook
    put "/admin/api/:api_version/webhooks/:webhook_id.json" do
      json_response 200, fixture(params[:api_version], "events/webhooks/update")
    end
    # Modify an existing Webhook
    delete "/admin/api/:api_version/webhooks/:webhook_id.json" do
      json_response 200, fixture(params[:api_version], "events/webhooks/destroy")
    end
    # Remove an existing Webhook
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fake_shopify-0.2.0 lib/fake_shopify/routes/events.rb
fake_shopify-0.1.1 lib/fake_shopify/routes/events.rb