Sha256: f1bb06a0d38afee5e54835524c786eac5ec2e8369632ceeb13bfa63c01304efc

Contents?: true

Size: 1.48 KB

Versions: 7

Compression:

Stored size: 1.48 KB

Contents

require "spec_helper"

describe Brightbox::CollaboratingAccount do
  include_context "collaborating accounts"

  let(:account) { Brightbox::CollaboratingAccount.new(initial_model) }

  describe "#resource_type" do
    context "when initialised with an Account" do
      let(:initial_model) { owned_account }

      it "returns 'account'" do
        expect(account.resource_type).to eql("account")
      end
    end

    context "when initialised with a User Collaboration" do
      let(:initial_model) { active_collaboration }

      it "returns 'collaboration'" do
        expect(account.resource_type).to eql("collaboration")
      end
    end
  end

  describe "#account?" do
    context "when initialised with an Account" do
      let(:initial_model) { owned_account }

      it "returns true" do
        expect(account.account?).to be_true
      end
    end

    context "when initialised with a User Collaboration" do
      let(:initial_model) { active_collaboration }

      it "returns false'" do
        expect(account.account?).to be_false
      end
    end
  end

  describe "#collaboration?" do
    context "when initialised with an Account" do
      let(:initial_model) { owned_account }

      it "returns false" do
        expect(account.collaboration?).to be_false
      end
    end

    context "when initialised with a User Collaboration" do
      let(:initial_model) { active_collaboration }

      it "returns true'" do
        expect(account.collaboration?).to be_true
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
brightbox-cli-1.2.2 spec/unit/brightbox/collaborating_account/resource_type_spec.rb
brightbox-cli-1.2.1 spec/unit/brightbox/collaborating_account/resource_type_spec.rb
brightbox-cli-1.2.0 spec/unit/brightbox/collaborating_account/resource_type_spec.rb
brightbox-cli-1.1.0 spec/unit/brightbox/collaborating_account/resource_type_spec.rb
brightbox-cli-1.0.0 spec/unit/brightbox/collaborating_account/resource_type_spec.rb
brightbox-cli-1.0.0.rc2 spec/unit/brightbox/collaborating_account/resource_type_spec.rb
brightbox-cli-1.0.0.rc1 spec/unit/brightbox/collaborating_account/resource_type_spec.rb