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
eb84a5b0
Commit
eb84a5b0
authored
Mar 21, 2016
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix key removal
parent
54108b6c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
app/workers/geo_key_refresh_worker.rb
app/workers/geo_key_refresh_worker.rb
+3
-2
spec/workers/geo_key_refresh_worker_spec.rb
spec/workers/geo_key_refresh_worker_spec.rb
+1
-1
No files found.
app/workers/geo_key_refresh_worker.rb
View file @
eb84a5b0
...
...
@@ -16,8 +16,9 @@ class GeoKeyRefreshWorker
key
=
Key
.
find
(
key_id
)
key
.
add_to_shell
when
:delete
# ActiveRecord::RecordNotFound when not found (so job will retry)
key
=
Key
.
find
(
key_id
)
# we are physically removing the key after model is removed
# so we must reconstruct ids to schedule removal
key
=
Key
.
new
(
id:
key_id
)
key
.
remove_from_shell
else
fail
"Invalid action:
#{
action
}
"
...
...
spec/workers/geo_key_refresh_worker_spec.rb
View file @
eb84a5b0
...
...
@@ -15,7 +15,7 @@ describe GeoKeyRefreshWorker do
context
'key removal'
do
it
'removes key from the shell'
do
expect
(
Key
).
to
receive
(
:
find
).
with
(
key
.
id
)
{
key
}
expect
(
Key
).
to
receive
(
:
new
).
with
(
id:
key
.
id
)
{
key
}
expect
(
key
).
to
receive
(
:remove_from_shell
)
expect
{
key_delete
}.
not_to
raise_error
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