Sha256: 9918c4b1d695cd3eb4a28367a80ca5aa4d721d6b3ed84e25c231f1b631c2830f

Contents?: true

Size: 1 KB

Versions: 7

Compression:

Stored size: 1 KB

Contents

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

module Troo
  module Remote
    module Persistence
      describe Board do
        let(:described_class) { Board }
        let(:resource_name)   { 'My New Board' }
        let(:description)     { 'A very brief description...' }

        describe '.with' do
          subject { described_class.with(resource_name, description) }

          context 'when the board was created' do
            before do
              VCR.insert_cassette(:create_board,
                                  decode_compressed_response: true)
            end

            after do
              database_cleanup
              VCR.eject_cassette
            end

            it 'returns the new board' do
              subject.must_be_instance_of Troo::Board
            end
          end

          context 'when the board was not created' do
            before { API::Client.stubs(:perform).returns([]) }

            it { subject.must_equal false }
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
troo-0.0.15 test/lib/troo/remote/persistence/board_test.rb
troo-0.0.14 test/lib/troo/remote/persistence/board_test.rb
troo-0.0.13 test/lib/troo/remote/persistence/board_test.rb
troo-0.0.12 test/lib/troo/remote/persistence/board_test.rb
troo-0.0.11 test/lib/troo/remote/persistence/board_test.rb
troo-0.0.10 test/lib/troo/remote/persistence/board_test.rb
troo-0.0.9 test/lib/troo/remote/persistence/board_test.rb