Sha256: 1519334e3c08c2af1643f453e552518400422a94a962a4d991b82d66b09c64c8

Contents?: true

Size: 1.16 KB

Versions: 3

Compression:

Stored size: 1.16 KB

Contents

require_relative "../../../test_helper"

module Troo
  describe MemberDecorator do
    let(:described_class) { MemberDecorator }
    let(:options) { {} }

    before { @member = Fabricate(:member) }
    after  { database_cleanup }

    describe "#initialize" do
      subject { described_class.new(@member, options) }

      it "assigns the member to an instance variable" do
        subject.instance_variable_get("@member").must_equal(@member)
      end

      it "assigns the options to an instance variable" do
        subject.instance_variable_get("@options").must_equal(options)
      end
    end

    describe "#username" do
      subject { described_class.new(@member).username }

      it "returns the member's username" do
        subject.must_equal("@#{@member.username}")
      end
    end

    describe "#name" do
      subject { described_class.new(@member).name }

      it "returns the member's full name" do
        subject.must_equal(@member.full_name)
      end
    end

    describe "#initials" do
      subject { described_class.new(@member).initials }

      it "returns the member's initials" do
        subject.must_equal(@member.initials)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
troo-0.0.7 test/lib/troo/display/member_decorator_test.rb
troo-0.0.6 test/lib/troo/display/member_decorator_test.rb
troo-0.0.5 test/lib/troo/display/member_decorator_test.rb