Sha256: d8f6154ea3230fa01ccfb1eff20a0ca924034cf15b29684c9611e11b9fe19f35

Contents?: true

Size: 752 Bytes

Versions: 5

Compression:

Stored size: 752 Bytes

Contents

require "spec_helper"

describe Ecommerce::Client do

  describe "#authenticated?" do
    context "with a valid token" do
      subject { described_class.new(Ecommerce.configuration.token, Ecommerce.configuration.secret) }

      it "returns true" do
        VCR.use_cassette("client/authenticated/true") do
          expect(subject.authenticated?('rexpense-custom-monthly-brl-5250')).to be_truthy
        end
      end
    end

    context "with an invalid token" do
      subject { described_class.new("FAKE-TOKEN", "FAKE-SECRET") }

      it "returns false" do
        VCR.use_cassette("client/authenticated/false") do
          expect(subject.authenticated?('rexpense-custom-monthly-brl-5250')).to be_falsey
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ecommerce-client-0.0.5 spec/ecommerce/client_spec.rb
ecommerce-client-0.0.4 spec/ecommerce/client_spec.rb
ecommerce-client-0.0.3 spec/ecommerce/client_spec.rb
ecommerce-client-0.0.2 spec/ecommerce/client_spec.rb
ecommerce-client-0.0.1 spec/ecommerce/client_spec.rb