summaryrefslogtreecommitdiff
path: root/spec/models/ci/build_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/ci/build_spec.rb')
-rw-r--r--spec/models/ci/build_spec.rb34
1 files changed, 14 insertions, 20 deletions
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb
index 1be1602fe36..5fa3059e55f 100644
--- a/spec/models/ci/build_spec.rb
+++ b/spec/models/ci/build_spec.rb
@@ -813,33 +813,27 @@ describe Ci::Build do
describe '.deployment' do
subject { build.deployment }
- context 'when there is an old deployment record' do
- before do
- create(:deployment, deployable: build, project: project)
- end
-
- context 'when there is a deployment record with created status' do
- let!(:deployment) { create(:deployment, deployable: build, project: project) }
+ context 'when there is a deployment record with created status' do
+ let!(:deployment) { create(:deployment, deployable: build, project: project) }
- it 'returns the record' do
- is_expected.to eq(deployment)
- end
+ it 'returns the record' do
+ is_expected.to eq(deployment)
end
+ end
- context 'when there is a deployment record with running status' do
- let!(:deployment) { create(:deployment, :running, deployable: build, project: project) }
+ context 'when there is a deployment record with running status' do
+ let!(:deployment) { create(:deployment, :running, deployable: build, project: project) }
- it 'returns the record' do
- is_expected.to eq(deployment)
- end
+ it 'returns the record' do
+ is_expected.to eq(deployment)
end
+ end
- context 'when there is a deployment record with success status' do
- let!(:deployment) { create(:deployment, :success, deployable: build, project: project) }
+ context 'when there is a deployment record with success status' do
+ let!(:deployment) { create(:deployment, :success, deployable: build, project: project) }
- it 'returns the record' do
- is_expected.to eq(deployment)
- end
+ it 'returns the record' do
+ is_expected.to eq(deployment)
end
end
end