Sha256: a53a4ded6f4bca92e0702095193c94b501b73d51b9f66c83133f3e03921bdbb4

Contents?: true

Size: 1.08 KB

Versions: 61

Compression:

Stored size: 1.08 KB

Contents

require "spec_helper"

describe Brightbox::CollaboratingAccount do
  include_context "collaborating accounts"

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

  describe "#role" do
    context "when account owner" do
      let(:initial_model) { owned_account }

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

    context "when an active account and collaboration" do
      let(:account) { Brightbox::CollaboratingAccount.new(initial_model, active_collaboration) }
      let(:initial_model) { owned_account }

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

    context "when an active collaboration" do
      let(:initial_model) { active_collaboration }

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

    context "when an pending collaboration" do
      let(:initial_model) { pending_collaboration }

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

Version data entries

61 entries across 61 versions & 1 rubygems

Version Path
brightbox-cli-4.8.0 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-4.7.0 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-4.6.0 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-4.5.0 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-4.5.0.rc1 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-4.4.0 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-4.3.2 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-4.3.1 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-4.3.0 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-4.2.1 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-4.2.0 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-4.1.0 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-4.0.0 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-4.0.0.rc2 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-3.3.0 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-3.2.0 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-3.1.0 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-3.0.1 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-3.0.0 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-2.12.0 spec/unit/brightbox/collaborating_account/role_spec.rb