Sha256: 1eaa29036e8727a4e20a822fa92757c1353e50e9fe45ad834ee6584a086c6f78

Contents?: true

Size: 1.1 KB

Versions: 1

Compression:

Stored size: 1.1 KB

Contents

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

module Troo
  module Commands
    module Add
      describe Board do
        let(:described_class) { Board }
        let(:value) { 'Add Board Test' }
        let(:id)    {}

        before do
          CreateBoard.stubs(:with).returns(false)
        end

        describe '#add' do
          subject { described_class.new(value, id).add }

          context 'when the parent resource exists' do
            context 'and the board was created' do
              before { CreateBoard.stubs(:with).returns(true) }

              it 'returns a polite message' do
                subject.must_match(/\'Add Board Test\' created/)
              end
            end

            context 'and the board was not created' do
              it 'returns a polite message' do
                subject.must_match(/could not/)
              end
            end
          end

          context 'when the parent resource does not exist' do
            it 'returns a polite message' do
              subject.must_match(/could not/)
            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/add/board_test.rb