Sha256: e78d8a046de94d5d8404831dc34c99e8069ffcfb606b07435c167fa40e84198b

Contents?: true

Size: 1.72 KB

Versions: 12

Compression:

Stored size: 1.72 KB

Contents

require "spec_helper"

describe Balanced do
  describe "configure" do
    use_vcr_cassette
    before do
      @api_key = Balanced::ApiKey.new.save

      Balanced.configure @api_key.secret
    end

    describe "api key" do
      describe "merchant" do
        subject { @api_key.merchant }
        it { should_not be_nil }
      end
    end

    describe "#client" do
      subject { Balanced.client }
      it { should_not be_nil }

      describe "#connection" do
        subject { Balanced.client.conn }
        it { should_not be_nil }
      end

      describe "#api_key" do
        subject { Balanced.client.api_key }
        it { should eql @api_key.secret }
      end

      describe "#url" do
        subject { Balanced.client.url.to_s }
        it { should eql "https://api.balancedpayments.com" }
      end
    end

    describe "reconfigure with new api key" do
      use_vcr_cassette
      before do
        @new_api_key = Balanced::ApiKey.new.save
        Balanced.configure @new_api_key.secret
      end

      describe "api key" do
        describe "merchant" do
          use_vcr_cassette
          subject { @api_key.merchant }
          it { should_not be_nil }
        end
      end

      describe "#client" do
        describe "#api_key" do
          subject { Balanced.client.api_key }
          it { should_not eql @api_key.secret }
          it { should eql @new_api_key.secret }
        end
      end

      describe "new api key" do
        describe "secret" do
          subject { @new_api_key.secret }
          it { should_not be_nil }

        end
        describe "merchant" do
          use_vcr_cassette

          subject { @new_api_key.merchant }
          it { should_not be_nil }
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
balanced-ach-0.1 spec/balanced_spec.rb
balanced-0.3.11 spec/balanced_spec.rb
balanced-0.3.10 spec/balanced_spec.rb
balanced-0.3.8 spec/balanced_spec.rb
balanced-0.3.7 spec/balanced_spec.rb
balanced-0.3.6 spec/balanced_spec.rb
balanced-0.3.5 spec/balanced_spec.rb
balanced-0.3.4 spec/balanced_spec.rb
balanced-0.3.3 spec/balanced_spec.rb
balanced-0.3.2 spec/balanced_spec.rb
balanced-0.3.1 spec/balanced_spec.rb
balanced-0.3.0 spec/balanced_spec.rb