Sha256: 2ea43a2a05ea94e5097e58bbe327551db1b52317cee110d25637b66efd91474e

Contents?: true

Size: 1.14 KB

Versions: 1

Compression:

Stored size: 1.14 KB

Contents

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

module Troo
  module Remote
    module Persistence
      describe List do
        let(:described_class)   { List }
        let(:external_board_id) { '20010' }
        let(:resource_name)     { 'My New List' }
        let(:list) do
          [Fabricate.build(:list, name: resource_name)]
        end

        before do
          Troo::Persistence::Local.stubs(:with_collection)
            .returns(list)
        end
        after  { database_cleanup }

        describe '.with' do
          before do
            VCR.insert_cassette(:create_list,
                                decode_compressed_response: true)
          end

          after  { VCR.eject_cassette }

          subject { described_class.with(@board, resource_name) }

          context 'when the list was created' do
            it 'returns the new list' do
              subject.must_be_instance_of Troo::List
            end
          end

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

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
troo-0.0.10 test/lib/troo/remote/persistence/list_test.rb