Sha256: 020910102986524d0a4378e0f991f30e09813543f757d8dc4b21669535575ee1

Contents?: true

Size: 1.36 KB

Versions: 18

Compression:

Stored size: 1.36 KB

Contents

require "spec_helper"

describe Brightbox::Account do
  before do
    # Unfortunately need to change $config for Api.conn to work until we can
    # eliminate the global class method
    $config = config_from_contents(contents)
  end

  describe ".all" do
    context "when connected using an application", :vcr 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 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

18 entries across 18 versions & 1 rubygems

Version Path
brightbox-cli-2.1.2 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-2.1.1 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-2.1.0 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-2.0.0 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-1.6.0 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-1.5.0 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-1.4.3 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-1.4.2 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-1.4.1 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-1.4.0 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-1.3.0 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-1.2.2 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-1.2.1 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-1.2.0 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-1.1.0 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-1.0.0 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-1.0.0.rc2 spec/unit/brightbox/account/all_spec.rb
brightbox-cli-1.0.0.rc1 spec/unit/brightbox/account/all_spec.rb