diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-10-13 13:58:25 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-10-13 13:58:25 +0300 |
commit | 204fdcb1abb9c76b2d4bd6260c6e5ce91529aeb8 (patch) | |
tree | 0e62bd21453b627ae74139c985cd0faec623479b /spec/workers/build_success_worker_spec.rb | |
parent | fafc5a1777484ba6b1b12c5e88f3fc783fb4d839 (diff) |
Add build success worker that runs asynchronously
Diffstat (limited to 'spec/workers/build_success_worker_spec.rb')
-rw-r--r-- | spec/workers/build_success_worker_spec.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/workers/build_success_worker_spec.rb b/spec/workers/build_success_worker_spec.rb new file mode 100644 index 00000000000..c42bcd45d50 --- /dev/null +++ b/spec/workers/build_success_worker_spec.rb @@ -0,0 +1,25 @@ +require 'spec_helper' + +describe BuildSuccessWorker do + describe '#perform' do + context 'when build exists' do + context 'when build belogs to the environment' do + let!(:build) { create(:ci_build, environment: 'production') } + + it 'executes deployment service' do + expect_any_instance_of(CreateDeploymentService) + .to receive(:execute) + + described_class.new.perform(build.id) + end + end + end + + context 'when build does not exist' do + it 'does not raise exception' do + expect { described_class.new.perform(123) } + .not_to raise_error + end + end + end +end |