Sha256: e0942e854dc1b44bab5e4e6853ad24b9dcb1e9e36ae17842af50a64529bdee30

Contents?: true

Size: 800 Bytes

Versions: 10

Compression:

Stored size: 800 Bytes

Contents

#
# webhooks_spec.rb
# ConstantContact
#
# Copyright (c) 2013 Constant Contact. All rights reserved.

require 'spec_helper'

describe ConstantContact::Webhooks do
  describe "test methods" do
    before(:each) do
      @webhooks = ConstantContact::WebhooksUtil.new('api-secret-key')
    end

    describe "#billing_change_notification" do
      it "gets the BillingChangeNotification model object" do
        hmac_header = 'VNfTwVDbHBoPqEYqDdM61OqxJdVznRzT4h21+BuwgTg='
        json_body = load_file('billing_change_notification_request.json')

        model = @webhooks.get_billing_change_notification(hmac_header, json_body)
        model.should be_kind_of(ConstantContact::Webhooks::Models::BillingChangeNotification)
        model.event_type.should eq('tier.increase')
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
constantcontact-4.0.0 spec/constantcontact/webhooks/webhooks_spec.rb
constantcontact-3.0.0 spec/constantcontact/webhooks/webhooks_spec.rb
constantcontact-2.2.1 spec/constantcontact/webhooks/webhooks_spec.rb
constantcontact-ruby-2.2.1 spec/constantcontact/webhooks/webhooks_spec.rb
constantcontact-ruby-2.2.0 spec/constantcontact/webhooks/webhooks_spec.rb
constantcontact-2.2.0 spec/constantcontact/webhooks/webhooks_spec.rb
constantcontact-2.1.0 spec/constantcontact/webhooks/webhooks_spec.rb
constantcontact-2.0.1 spec/constantcontact/webhooks/webhooks_spec.rb
constantcontact-2.0.0 spec/constantcontact/webhooks/webhooks_spec.rb
constantcontact-1.3.2 spec/constantcontact/webhooks/webhooks_spec.rb