Sha256: 9a0f5d766bef8ffb85d3839308310a98ea591b693dd866085de45a673f149953
Contents?: true
Size: 862 Bytes
Versions: 16
Compression:
Stored size: 862 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) allow(subject).to receive(:say) { |m| messages << m } 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
16 entries across 16 versions & 1 rubygems