Sha256: 1e71d1981aff77753e119b0feba3fe8b0879f321d5984ae90002b7453f10baf6

Contents?: true

Size: 1.13 KB

Versions: 1

Compression:

Stored size: 1.13 KB

Contents

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

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

        before do
          Retrieval::List.stubs(:retrieve)
          CreateCard.stubs(:for).returns(false)
        end

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

          context 'when the parent resource exists' do
            context 'and the card was created' do
              before { CreateCard.stubs(:for).returns(true) }

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

            context 'and the card 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/card_test.rb