From 07fc2f852a0b4136b6d97c1d9773819c47e7e8e7 Mon Sep 17 00:00:00 2001 From: "Z.J. van de Weg" Date: Tue, 9 Aug 2016 15:11:14 +0200 Subject: Method names changed to #includes_commit? --- spec/models/deployment_spec.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'spec/models/deployment_spec.rb') 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 -- cgit v1.2.3