Sha256: 23e6b85dd82f5cb2cf28bec76e0f67ac86b72ba2302ee496dd8125b1477a5b5c

Contents?: true

Size: 884 Bytes

Versions: 1

Compression:

Stored size: 884 Bytes

Contents

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

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

        before do
          @board = Fabricate.build(:board)
          Retrieval::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
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
troo-0.0.8 test/lib/troo/commands/show/boards_test.rb