Sha256: e83ed23a3f437c768e4e46acee687915b7b70da22b190e6ddfba290e3bf80048

Contents?: true

Size: 1.26 KB

Versions: 23

Compression:

Stored size: 1.26 KB

Contents

require "spec_helper"

describe Brightbox::Account do
  before do
    Brightbox.config = config_from_contents(contents)
  end

  describe ".all" do
    context "when connected using an application", vcr: true do
      let(:contents) { USER_APP_CONFIG_CONTENTS }

      it "returns a collection of Accounts" do
        expect(Brightbox::Account.all).to be_kind_of(Array)

        Brightbox::Account.all.each do |account|
          expect(account).to be_kind_of(Fog::Brightbox::Compute::Account)
        end
      end

      it "returns resources on the same connection" do
        Brightbox::Account.all.each do |account|
          expect(account.service).to eql(Brightbox::Account.conn)
        end
      end
    end

    context "when connected using an client", vcr: true do
      let(:contents) { API_CLIENT_CONFIG_CONTENTS }

      it "returns a collection of Accounts" do
        expect(Brightbox::Account.all).to be_kind_of(Array)

        Brightbox::Account.all.each do |account|
          expect(account).to be_kind_of(Fog::Brightbox::Compute::Account)
        end
      end

      it "returns resources on the same connection" do
        Brightbox::Account.all.each do |account|
          expect(account.service).to eql(Brightbox::Account.conn)
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
brightbox-cli-5.0.0 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-5.0.0.rc2 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-5.0.0.rc1 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-5.0.0.alpha spec/unit/brightbox/account/all_spec.rb
brightbox-cli-4.8.0 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-4.7.0 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-4.6.0 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-4.5.0 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-4.5.0.rc1 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-4.4.0 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-4.3.2 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-4.3.1 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-4.3.0 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-4.2.1 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-4.2.0 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-4.1.0 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-4.0.0 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-4.0.0.rc2 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-3.3.0 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-3.2.0 spec/unit/brightbox/account/all_spec.rb