Sha256: bb0912a9bf92d8069bae5bf8b1731241be7dad378fc9dc0eed0498591d57826b

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::Compute::Brightbox::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::Compute::Brightbox::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-2.12.0 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-2.11.2 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-2.11.1 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-2.11.0 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-2.10.0 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-2.9.3 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-2.9.2 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-2.9.1 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-2.9.0 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-2.8.2 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-2.8.1 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-2.8.0 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-2.7.1 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-2.7.0 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-2.6.0 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-2.5.0 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-2.4.1 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-2.4.0 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-2.3.4 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-2.3.3 spec/unit/brightbox/account/all_spec.rb