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:
authorZ.J. van de Weg <zegerjan@gitlab.com>2016-08-09 16:11:14 +0300
committerZ.J. van de Weg <zegerjan@gitlab.com>2016-08-12 11:43:04 +0300
commit07fc2f852a0b4136b6d97c1d9773819c47e7e8e7 (patch)
treeb80f5200b1d7398eadc9b7ae029873f3cc6ad93a /spec/models/deployment_spec.rb
parent03ea01946524a74773b24430c81804c2724b84b6 (diff)
Method names changed to #includes_commit?
Diffstat (limited to 'spec/models/deployment_spec.rb')
-rw-r--r--spec/models/deployment_spec.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/spec/models/deployment_spec.rb b/spec/models/deployment_spec.rb
index d7cb142dd32..bfff639ad78 100644
--- a/spec/models/deployment_spec.rb
+++ b/spec/models/deployment_spec.rb
@@ -16,23 +16,26 @@ describe Deployment, models: true do
it { is_expected.to validate_presence_of(:ref) }
it { is_expected.to validate_presence_of(:sha) }
- describe '#deployed_to?' do
+ describe '#includes_commit?' do
let(:project) { create(:project) }
let(:environment) { create(:environment, project: project) }
let(:deployment) do
- create(:deployment, environment: environment,
- sha: '5f923865dde3436854e9ceb9cdb7815618d4e849')
+ create(:deployment, environment: environment, sha: project.commit.id)
end
context 'when there is no project commit' do
it 'returns false' do
- expect(deployment.deployed_to?('random-branch')).to be false
+ commit = project.commit('feature')
+
+ expect(deployment.includes_commit?(commit)).to be false
end
end
context 'when they share the same tree branch' do
it 'returns true' do
- expect(deployment.deployed_to?('HEAD')).to be true
+ commit = project.commit
+
+ expect(deployment.includes_commit?(commit)).to be true
end
end
end