Sha256: 208629bdd8d733bf4e53a20f494660e5f8217429381c42b832d871c1bd182c92
Contents?: true
Size: 1.79 KB
Versions: 23
Compression:
Stored size: 1.79 KB
Contents
require "spec_helper" describe Brightbox::Account do before do skip "recordings corrupted and no longer working" end describe ".get" do context "when connected using an application" do before do Brightbox::Api.configuration = USER_APP_CONFIG end context "and the account is accessible", vcr: true do before do @account_id = "acc-12345" @account = Brightbox::Account.get(@account_id) end it "returns requested account" do expect(@account).to be_kind_of(Fog::Brightbox::Compute::Account) expect(@account.id).to eql(@account_id) end it "returns the resource on the same connection" do expect(@account.service).to eql(Brightbox::Account.conn) end end context "and the account is unknown", vcr: true do it "returns nil" do expect(Brightbox::Account.get("acc-xxxxx")).to be_nil end end end context "when connected using an client", vcr: true do before do Brightbox::Api.configuration = API_CLIENT_CONFIG end context "and the account is accessible", vcr: true do before do @account_id = "acc-12345" @account = Brightbox::Account.get(@account_id) end it "returns the client's owning account" do expect(@account).to be_kind_of(Fog::Brightbox::Compute::Account) expect(@account.id).to eql(@account_id) end it "returns the resource on the same connection" do expect(@account.service).to eql(Brightbox::Account.conn) end end context "and the account is unknown", vcr: true do it "returns nil" do expect(Brightbox::Account.get("acc-xxxxx")).to be_nil end end end end end
Version data entries
23 entries across 23 versions & 1 rubygems