Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
3e812b1f
Commit
3e812b1f
authored
Mar 02, 2020
by
Jason Goodman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make ref_path private in Deployment
Avoid using send in Deployments::AfterCreateService spec
parent
2f22edb3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
app/models/deployment.rb
app/models/deployment.rb
+2
-2
spec/services/deployments/after_create_service_spec.rb
spec/services/deployments/after_create_service_spec.rb
+1
-1
No files found.
app/models/deployment.rb
View file @
3e812b1f
...
@@ -280,12 +280,12 @@ class Deployment < ApplicationRecord
...
@@ -280,12 +280,12 @@ class Deployment < ApplicationRecord
errors
.
add
(
:ref
,
_
(
'The branch or tag does not exist'
))
errors
.
add
(
:ref
,
_
(
'The branch or tag does not exist'
))
end
end
private
def
ref_path
def
ref_path
File
.
join
(
environment
.
ref_path
,
'deployments'
,
iid
.
to_s
)
File
.
join
(
environment
.
ref_path
,
'deployments'
,
iid
.
to_s
)
end
end
private
def
legacy_finished_at
def
legacy_finished_at
self
.
created_at
if
success?
&&
!
read_attribute
(
:finished_at
)
self
.
created_at
if
success?
&&
!
read_attribute
(
:finished_at
)
end
end
...
...
spec/services/deployments/after_create_service_spec.rb
View file @
3e812b1f
...
@@ -49,7 +49,7 @@ describe Deployments::AfterCreateService do
...
@@ -49,7 +49,7 @@ describe Deployments::AfterCreateService do
it
'creates ref'
do
it
'creates ref'
do
expect_any_instance_of
(
Repository
)
expect_any_instance_of
(
Repository
)
.
to
receive
(
:create_ref
)
.
to
receive
(
:create_ref
)
.
with
(
deployment
.
sha
,
deployment
.
send
(
:ref_path
)
)
.
with
(
deployment
.
sha
,
"refs/environments/production/deployments/
#{
deployment
.
iid
}
"
)
service
.
execute
service
.
execute
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment