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
0
Merge Requests
0
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
Tatuya Kamada
gitlab-ce
Commits
adc71b6a
Commit
adc71b6a
authored
Aug 29, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix test i broke with ssk key validation. Added Key.user_id as attr_protected
parent
5afb16e4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
8 deletions
+10
-8
app/models/key.rb
app/models/key.rb
+3
-1
features/profile/ssh_keys.feature
features/profile/ssh_keys.feature
+2
-2
features/step_definitions/profile/profile_keys_steps.rb
features/step_definitions/profile/profile_keys_steps.rb
+1
-1
spec/requests/projects_deploy_keys_spec.rb
spec/requests/projects_deploy_keys_spec.rb
+4
-4
No files found.
app/models/key.rb
View file @
adc71b6a
...
@@ -4,13 +4,15 @@ class Key < ActiveRecord::Base
...
@@ -4,13 +4,15 @@ class Key < ActiveRecord::Base
belongs_to
:user
belongs_to
:user
belongs_to
:project
belongs_to
:project
attr_protected
:user_id
validates
:title
,
validates
:title
,
presence:
true
,
presence:
true
,
length:
{
within:
0
..
255
}
length:
{
within:
0
..
255
}
validates
:key
,
validates
:key
,
presence:
true
,
presence:
true
,
:format
=>
{
:with
=>
/ssh-.{3} /
},
format:
{
:with
=>
/ssh-.{3} /
},
length:
{
within:
0
..
5000
}
length:
{
within:
0
..
5000
}
before_save
:set_identifier
before_save
:set_identifier
...
...
features/profile/ssh_keys.feature
View file @
adc71b6a
...
@@ -3,8 +3,8 @@ Feature: SSH Keys
...
@@ -3,8 +3,8 @@ Feature: SSH Keys
Given
I signin as a user
Given
I signin as a user
And I have ssh keys
:
And I have ssh keys
:
|
title
|
|
title
|
|
Work
|
|
ssh-rsa
Work
|
|
Home
|
|
ssh-rsa
Home
|
And
I visit profile keys page
And
I visit profile keys page
Scenario
:
I
should see SSH keys
Scenario
:
I
should see SSH keys
...
...
features/step_definitions/profile/profile_keys_steps.rb
View file @
adc71b6a
...
@@ -16,7 +16,7 @@ end
...
@@ -16,7 +16,7 @@ end
Given
/^I submit new ssh key "(.*?)"$/
do
|
arg1
|
Given
/^I submit new ssh key "(.*?)"$/
do
|
arg1
|
fill_in
"key_title"
,
:with
=>
arg1
fill_in
"key_title"
,
:with
=>
arg1
fill_in
"key_key"
,
:with
=>
"publickey234="
fill_in
"key_key"
,
:with
=>
"
ssh-rsa
publickey234="
click_button
"Save"
click_button
"Save"
end
end
...
...
spec/requests/projects_deploy_keys_spec.rb
View file @
adc71b6a
...
@@ -42,7 +42,7 @@ describe "Projects", "DeployKeys" do
...
@@ -42,7 +42,7 @@ describe "Projects", "DeployKeys" do
describe
"fill in"
do
describe
"fill in"
do
before
do
before
do
fill_in
"key_title"
,
with:
"laptop"
fill_in
"key_title"
,
with:
"laptop"
fill_in
"key_key"
,
with:
"publickey234="
fill_in
"key_key"
,
with:
"
ssh-rsa
publickey234="
end
end
it
{
expect
{
click_button
"Save"
}.
to
change
{
Key
.
count
}.
by
(
1
)
}
it
{
expect
{
click_button
"Save"
}.
to
change
{
Key
.
count
}.
by
(
1
)
}
...
@@ -55,12 +55,12 @@ describe "Projects", "DeployKeys" do
...
@@ -55,12 +55,12 @@ describe "Projects", "DeployKeys" do
end
end
end
end
describe
"Show page"
do
describe
"Show page"
do
before
do
before
do
@key
=
Factory
:key
,
project:
project
@key
=
Factory
:key
,
project:
project
visit
project_deploy_key_path
(
project
,
@key
)
visit
project_deploy_key_path
(
project
,
@key
)
end
end
it
{
page
.
should
have_content
@key
.
title
}
it
{
page
.
should
have_content
@key
.
title
}
it
{
page
.
should
have_content
@key
.
key
[
0
..
10
]
}
it
{
page
.
should
have_content
@key
.
key
[
0
..
10
]
}
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