Sha256: 5f2a7366e2b7df8141660451943ba049713033373ccb91f380f618ad6196873b
Contents?: true
Size: 804 Bytes
Versions: 24
Compression:
Stored size: 804 Bytes
Contents
require 'spec_helper' describe Aptible::CLI::Agent do let(:token) { 'some-token' } let(:operation) { Fabricate(:operation) } before do allow(subject).to receive(:fetch_token).and_return(token) end describe '#operation:cancel' do it 'fails if the operation cannot be found' do expect(Aptible::Api::Operation).to receive(:find).with(1, token: token) .and_return(nil) expect { subject.send('operation:cancel', 1) } .to raise_error('Operation #1 not found') end it 'sets the cancelled flag on the operation' do expect(Aptible::Api::Operation).to receive(:find).with(1, token: token) .and_return(operation) expect(operation).to receive(:update!).with(cancelled: true) subject.send('operation:cancel', 1) end end end
Version data entries
24 entries across 24 versions & 1 rubygems