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-2.3.1 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-2.3.0 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-2.2.0 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-2.1.2 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-2.1.1 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-2.1.0 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-2.0.0 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-1.6.0 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-1.5.0 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-1.4.3 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-1.4.2 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-1.4.1 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-1.4.0 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-1.3.0 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-1.2.2 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-1.2.1 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-1.2.0 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-1.1.0 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-1.0.0 spec/unit/brightbox/collaborating_account/role_spec.rb
brightbox-cli-1.0.0.rc2 spec/unit/brightbox/collaborating_account/role_spec.rb