Sha256: 99c93a4d15cb00675f371bfad6215bc456dd7b74123d860a6936d894526835ef

Contents?: true

Size: 1.54 KB

Versions: 3

Compression:

Stored size: 1.54 KB

Contents

require 'spec_helper'

describe Conekta::Webhook do
  let!(:events) do
    {
      events: [
        "charge.created", "charge.paid", "charge.under_fraud_review",
        "charge.fraudulent", "charge.refunded", "charge.created", "customer.created",
        "customer.updated", "customer.deleted", "webhook.created", "webhook.updated",
        "webhook.deleted", "charge.chargeback.created", "charge.chargeback.updated",
        "charge.chargeback.under_review", "charge.chargeback.lost", "charge.chargeback.won",
        "payout.created", "payout.retrying", "payout.paid_out", "payout.failed",
        "plan.created", "plan.updated", "plan.deleted", "subscription.created",
        "subscription.paused", "subscription.resumed", "subscription.canceled",
        "subscription.expired", "subscription.updated", "subscription.paid",
        "subscription.payment_failed", "payee.created", "payee.updated",
        "payee.deleted", "payee.payout_method.created",
        "payee.payout_method.updated", "payee.payout_method.deleted"
      ]
    }
  end
  let(:url) { { url: "http://localhost:3000/my_listener" } }

  # This spec was commented to avoid webhook creation saturation.
  # 
  # it "succesfully gets charge" do
  #   webhook =  Conekta::Webhook.create(url.merge(events))
  #   expect(webhook.url).to eq(url[:url])
  #   webhook = Conekta::Webhook.find(webhook.id)
  #   expect(webhook.url).to eq(url[:url])
  #   webhook.update({url: "http://localhost:2000/my_listener"})
  #   expect(webhook.url).to eq("http://localhost:2000/my_listener")
  #   webhook.delete
  # end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
conekta-1.0.0 spec/conekta/webhook_spec.rb
conekta-0.5.8 spec/conekta/webhook_spec.rb
conekta-0.5.7 spec/conekta/webhook_spec.rb