Sha256: 794f6883dfd51d21ec00b698d33b46dad63812a9fc6a93c7cc22d9e04e7cb24e

Contents?: true

Size: 856 Bytes

Versions: 4

Compression:

Stored size: 856 Bytes

Contents

require_relative '../../../../../test_helper'

module Troo
  module Commands
    describe ShowBoards do
      let(:described_class) { ShowBoards }
      let(:resources) { [] }

      before do
        API::Client.stubs(:perform)
        @board = Fabricate.build(:board)
        Troo::Board.stubs(:all).returns(resources)
        Presenters::Board.stubs(:all).returns(@board.name)
      end

      describe '.dispatch' do
        subject { described_class.dispatch }

        context 'when boards exist' do
          let(:resources) { [@board] }

          it 'presents the boards' do
            subject.must_match(/#{@board.name}/)
          end
        end

        context 'when no boards exist' do
          it 'returns a polite message' do
            subject.must_match(/Boards cannot be found/)
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
troo-0.0.12 test/lib/troo/cli/commands/show/show_boards_test.rb
troo-0.0.11 test/lib/troo/cli/commands/show/show_boards_test.rb
troo-0.0.10 test/lib/troo/cli/commands/show/show_boards_test.rb
troo-0.0.9 test/lib/troo/cli/commands/show/show_boards_test.rb