Sha256: 7883f59dc6de31cddf77767c4e3f2f3137baede8a1830cd702335da301db8a90

Contents?: true

Size: 1.13 KB

Versions: 6

Compression:

Stored size: 1.13 KB

Contents

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

module Troo
  describe Board do
    let(:described_class) { Board }
    let(:described_instance) { Fabricate.build(:board) }

    subject { described_instance }

    context "attributes" do
      it "should have a name attribute" do
        subject.name.must_equal "My Test Board"
      end

      it "should have a description attribute" do
        subject.description.must_equal "A very brief description..."
      end

      it "should have a default attribute" do
        subject.default.must_equal false
      end

      it "should have a closed attribute" do
        subject.closed.must_equal false
      end

      it "should have an external_board_id attribute" do
        subject.external_board_id.must_equal "526d8e130a14a9d846001d96"
      end
    end

    context "associations" do
      before do
        @list  = Fabricate(:list)
        @card  = Fabricate(:card)
      end

      after { database_cleanup }

      it "can have many lists" do
        subject.lists.size.must_equal 1
      end

      it "can have many cards" do
        subject.cards.size.must_equal 1
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
troo-0.0.7 test/lib/troo/models/board_test.rb
troo-0.0.6 test/lib/troo/models/board_test.rb
troo-0.0.5 test/lib/troo/models/board_test.rb
troo-0.0.4 test/lib/troo/models/board_test.rb
troo-0.0.3 test/lib/troo/models/board_test.rb
troo-0.0.2 test/lib/troo/models/board_test.rb