BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
eaa1ce4f
Unverified
Commit
eaa1ce4f
authored
Oct 03, 2017
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure key fingerprints are generated correctly when modified
parent
66dd045e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
key.rb
app/models/key.rb
+1
-0
key_spec.rb
spec/models/key_spec.rb
+10
-0
No files found.
app/models/key.rb
View file @
eaa1ce4f
...
...
@@ -34,6 +34,7 @@ class Key < ActiveRecord::Base
value
&
.
delete!
(
"
\n\r
"
)
value
.
strip!
unless
value
.
blank?
write_attribute
(
:key
,
value
)
@public_key
=
nil
end
def
publishable_key
...
...
spec/models/key_spec.rb
View file @
eaa1ce4f
...
...
@@ -155,5 +155,15 @@ describe Key, :mailer do
it
'strips white spaces'
do
expect
(
described_class
.
new
(
key:
"
#{
valid_key
}
"
).
key
).
to
eq
(
valid_key
)
end
it
'invalidates the public_key attribute'
do
key
=
build
(
:key
)
original
=
key
.
public_key
key
.
key
=
valid_key
expect
(
original
.
key_text
).
not_to
be_nil
expect
(
key
.
public_key
.
key_text
).
to
eq
(
valid_key
)
end
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