Sha256: c489d9b8a86c8aa572f82ffb7d0ee67bbc3b482ea0f139e9f6aad8eb5c9fd094

Contents?: true

Size: 908 Bytes

Versions: 3

Compression:

Stored size: 908 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 }

        it { subject.must_be_instance_of(String) }

        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

3 entries across 3 versions & 1 rubygems

Version Path
troo-0.0.15 test/lib/troo/cli/commands/show/show_boards_test.rb
troo-0.0.14 test/lib/troo/cli/commands/show/show_boards_test.rb
troo-0.0.13 test/lib/troo/cli/commands/show/show_boards_test.rb