Commit 3e812b1f authored by Jason Goodman's avatar Jason Goodman

Make ref_path private in Deployment

Avoid using send in Deployments::AfterCreateService spec
parent 2f22edb3
......@@ -280,12 +280,12 @@ class Deployment < ApplicationRecord
errors.add(:ref, _('The branch or tag does not exist'))
end
private
def ref_path
File.join(environment.ref_path, 'deployments', iid.to_s)
end
private
def legacy_finished_at
self.created_at if success? && !read_attribute(:finished_at)
end
......
......@@ -49,7 +49,7 @@ describe Deployments::AfterCreateService do
it 'creates ref' do
expect_any_instance_of(Repository)
.to receive(:create_ref)
.with(deployment.sha, deployment.send(:ref_path))
.with(deployment.sha, "refs/environments/production/deployments/#{deployment.iid}")
service.execute
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment