Sha256: e75780324826456fba07dd8d856321fd6e924cf52130a6c7d3d43ba9baa20252

Contents?: true

Size: 895 Bytes

Versions: 3

Compression:

Stored size: 895 Bytes

Contents

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

module Troo
  module Commands
    describe RefreshAll do
      let(:described_class) { RefreshAll }
      let(:resource)        {
        [mock_trello_response('board_200.json', Troo::Remote::Board)]
      }

      before { Retrieval::Remote.stubs(:fetch).returns(resource) }

      describe '.dispatch' do
        subject { described_class.dispatch }

        it { subject.must_be_instance_of(String) }

        context 'when all the resources are refreshed' do
          it 'returns a polite message' do
            subject.must_match(/All local data refreshed/)
          end
        end

        context 'when all the resources are not refreshed' do
          let(:resource) { [] }

          it 'returns a polite message' do
            subject.must_match(/Cannot refresh all local data/)
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
troo-0.0.15 test/lib/troo/cli/commands/refresh/all_test.rb
troo-0.0.14 test/lib/troo/cli/commands/refresh/all_test.rb
troo-0.0.13 test/lib/troo/cli/commands/refresh/all_test.rb