Sha256: 66c2a855489580457f9f0cceb528eb33aeab45694833db9084c4dc723e1084e3

Contents?: true

Size: 1.13 KB

Versions: 1

Compression:

Stored size: 1.13 KB

Contents

require "spec_helper"

describe Emites::Client do
  let(:token) { "7A75E575CFDEDB91FF7E2CE22089181A" }
  subject     { described_class.new(token) }

  describe "#authenticated?" do
    context "with a valid token" do
      it "returns true" do
        VCR.use_cassette("client/authenticated/true") do
          expect(subject.authenticated?).to be_truthy
        end
      end
    end

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

      it "returns false" do
        VCR.use_cassette("client/authenticated/false") do
          expect(subject.authenticated?).to be_falsey
        end
      end
    end
  end

  describe "#emitters" do
    it "returns an instance of Emites::Resources::Emitter" do
      expect(subject.emitters).to be_a(Emites::Resources::Emitter)
    end
  end

  describe "#webhooks" do
    it "returns an instance of Emites::Resources::Webhook" do
      expect(subject.webhooks).to be_a(Emites::Resources::Webhook)
    end
  end

  describe "#nfse" do
    it "returns an instance of Emites::Resources::Nfse" do
      expect(subject.nfse).to be_a(Emites::Resources::Nfse)
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
emites-client-0.0.2 spec/emites/client_spec.rb