2014-06-19 21:47:41 +01:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe AbfWorkerService::Container do
|
|
|
|
let(:build_list) { FactoryGirl.build(:build_list, id: 123) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
stub_symlink_methods
|
|
|
|
end
|
|
|
|
|
|
|
|
subject { AbfWorkerService::Container.new(build_list) }
|
|
|
|
|
|
|
|
context '#create!' do
|
|
|
|
|
|
|
|
it 'creates task' do
|
2014-06-27 18:06:09 +01:00
|
|
|
expect(build_list).to_not receive(:fail_publish_container)
|
2014-06-19 21:47:41 +01:00
|
|
|
expect(Resque).to receive(:push)
|
|
|
|
subject.create!
|
|
|
|
end
|
|
|
|
|
2014-06-27 18:06:09 +01:00
|
|
|
it 'fails when no packages on FS' do
|
|
|
|
expect(subject).to receive(:filter_build_lists_without_packages).and_return([])
|
|
|
|
expect(build_list).to receive(:fail_publish_container)
|
|
|
|
expect(Resque).to_not receive(:push)
|
|
|
|
subject.create!
|
|
|
|
end
|
|
|
|
|
2014-06-19 21:47:41 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|