Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2018-10-18 09:47:30 +0300
committerShinya Maeda <shinya@gitlab.com>2018-10-18 09:47:30 +0300
commit3fb7a1f97a812b7b2b5e80a8a0575cb7bfd2d3c4 (patch)
tree51acab2b444bb5f7fffcda58f5b2b63c449c2342 /spec/models/deployment_spec.rb
parentc8c01bbe0229128f898df167aa7fcc3ef927c4d0 (diff)
Add spec for Deployment#scheduled_actions
Diffstat (limited to 'spec/models/deployment_spec.rb')
-rw-r--r--spec/models/deployment_spec.rb17
1 files changed, 16 insertions, 1 deletions
diff --git a/spec/models/deployment_spec.rb b/spec/models/deployment_spec.rb
index 86518c632df..9007418ac35 100644
--- a/spec/models/deployment_spec.rb
+++ b/spec/models/deployment_spec.rb
@@ -12,11 +12,26 @@ describe Deployment do
it { is_expected.to delegate_method(:commit).to(:project) }
it { is_expected.to delegate_method(:commit_title).to(:commit).as(:try) }
it { is_expected.to delegate_method(:manual_actions).to(:deployable).as(:try) }
- it { is_expected.to delegate_method(:scheduled_actions).to(:deployable).as(:try) }
it { is_expected.to validate_presence_of(:ref) }
it { is_expected.to validate_presence_of(:sha) }
+ describe '#scheduled_actions' do
+ subject { deployment.scheduled_actions }
+
+ let(:project) { create(:project, :repository) }
+ let(:pipeline) { create(:ci_pipeline, project: project) }
+ let(:build) { create(:ci_build, :success, pipeline: pipeline) }
+ let(:deployment) { create(:deployment, deployable: build) }
+
+ it 'delegates to other_scheduled_actions' do
+ expect_any_instance_of(Ci::Build)
+ .to receive(:other_scheduled_actions)
+
+ subject
+ end
+ end
+
describe 'modules' do
it_behaves_like 'AtomicInternalId' do
let(:internal_id_attribute) { :iid }