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
Kazuhiko Shiozaki
gitlab-ce
Commits
7aeb92b8
Commit
7aeb92b8
authored
Sep 10, 2012
by
Nihad Abbasov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rewrite profile feature steps using spinach
parent
d74f5473
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
114 additions
and
10 deletions
+114
-10
features/profile/profile.feature
features/profile/profile.feature
+2
-2
features/profile/ssh_keys.feature
features/profile/ssh_keys.feature
+5
-8
features/steps/profile.rb
features/steps/profile.rb
+57
-0
features/steps/profile_ssh_keys.rb
features/steps/profile_ssh_keys.rb
+50
-0
No files found.
features/profile/profile.feature
View file @
7aeb92b8
Feature
:
Profile
Feature
:
Profile
Background
:
Background
:
Given
I signin as a user
Given
I sign
in as a user
Scenario
:
I
look at my profile
Scenario
:
I
look at my profile
Given
I visit profile page
Given
I visit profile page
...
...
features/profile/ssh_keys.feature
View file @
7aeb92b8
Feature
:
SSH Keys
Feature
:
Profile SSH Keys
Background
:
Background
:
Given
I signin as a user
Given
I sign in as a user
And I have ssh keys
:
And
I have ssh key
"ssh-rsa Work"
|
title
|
|
ssh-rsa
Work
|
|
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
Then
I should see my ssh keys
Then
I should see my ssh keys
Scenario
:
Add new ssh key
Scenario
:
Add new ssh key
...
...
features/steps/profile.rb
0 → 100644
View file @
7aeb92b8
class
Profile
<
Spinach
::
FeatureSteps
Given
'I visit profile page'
do
visit
profile_path
end
Then
'I should see my profile info'
do
page
.
should
have_content
"Profile"
page
.
should
have_content
@user
.
name
page
.
should
have_content
@user
.
email
end
Then
'I change my contact info'
do
fill_in
"user_skype"
,
:with
=>
"testskype"
fill_in
"user_linkedin"
,
:with
=>
"testlinkedin"
fill_in
"user_twitter"
,
:with
=>
"testtwitter"
click_button
"Save"
@user
.
reload
end
And
'I should see new contact info'
do
@user
.
skype
.
should
==
'testskype'
@user
.
linkedin
.
should
==
'testlinkedin'
@user
.
twitter
.
should
==
'testtwitter'
end
Given
'I visit profile password page'
do
visit
profile_password_path
end
Then
'I change my password'
do
fill_in
"user_password"
,
:with
=>
"222333"
fill_in
"user_password_confirmation"
,
:with
=>
"222333"
click_button
"Save"
end
And
'I should be redirected to sign in page'
do
current_path
.
should
==
new_user_session_path
end
Given
'I visit profile token page'
do
visit
profile_token_path
end
Then
'I reset my token'
do
@old_token
=
@user
.
private_token
click_button
"Reset"
end
And
'I should see new token'
do
find
(
"#token"
).
value
.
should_not
==
@old_token
find
(
"#token"
).
value
.
should
==
@user
.
reload
.
private_token
end
Given
'I sign in as a user'
do
login_as
:user
end
end
features/steps/profile_ssh_keys.rb
0 → 100644
View file @
7aeb92b8
class
ProfileSshKeys
<
Spinach
::
FeatureSteps
Then
'I should see my ssh keys'
do
@user
.
keys
.
each
do
|
key
|
page
.
should
have_content
(
key
.
title
)
end
end
Given
'I click link "Add new"'
do
click_link
"Add new"
end
And
'I submit new ssh key "Laptop"'
do
fill_in
"key_title"
,
:with
=>
"Laptop"
fill_in
"key_key"
,
:with
=>
"ssh-rsa publickey234="
click_button
"Save"
end
Then
'I should see new ssh key "Laptop"'
do
key
=
Key
.
find_by_title
(
"Laptop"
)
page
.
should
have_content
(
key
.
title
)
page
.
should
have_content
(
key
.
key
)
current_path
.
should
==
key_path
(
key
)
end
Given
'I click link "Work"'
do
click_link
"Work"
end
And
'I click link "Remove"'
do
click_link
"Remove"
end
Then
'I visit profile keys page'
do
visit
keys_path
end
And
'I should not see "Work" ssh key'
do
within
"#keys-table"
do
page
.
should_not
have_content
"Work"
end
end
Given
'I sign in as a user'
do
login_as
:user
end
And
'I have ssh key "ssh-rsa Work"'
do
Factory
:key
,
:user
=>
@user
,
:title
=>
"ssh-rsa Work"
,
:key
=>
"jfKLJDFKSFJSHFJssh-rsa Work"
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