Sha256: b716eff5ea0485c4e651f3e9426986f2eb80ed2385fd1d4f281071d136d4a30b

Contents?: true

Size: 892 Bytes

Versions: 1

Compression:

Stored size: 892 Bytes

Contents

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

module Troo
  module Commands
    module Default
      describe Board do
        let(:described_class) { Board }
        let(:id) { '1' }

        before do
          @board = Fabricate.build(:board)
          Retrieval::Board.stubs(:retrieve).returns(resource)
        end

        describe '.dispatch' do
          subject { described_class.dispatch(id) }

          context 'when the resource exists' do
            let(:resource) { @board }

            it 'sets the default and returns a polite message' do
              subject.must_match(/set as default/)
            end
          end

          context 'when the resource does not exist' do
            let(:resource) {}

            it 'returns a polite message' do
              subject.must_match(/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/default/board_test.rb