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
96e0020c
Commit
96e0020c
authored
Aug 30, 2017
by
blackst0ne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace 'project/user_lookup.feature' spinach test with an rspec analog
parent
ef8eb3f6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
65 deletions
+49
-65
changelogs/unreleased/replace_spinach_user_lookup-feature.yml
...gelogs/unreleased/replace_spinach_user_lookup-feature.yml
+5
-0
features/project/commits/user_lookup.feature
features/project/commits/user_lookup.feature
+0
-16
features/steps/project/commits/user_lookup.rb
features/steps/project/commits/user_lookup.rb
+0
-49
spec/features/projects/commits/rss_spec.rb
spec/features/projects/commits/rss_spec.rb
+0
-0
spec/features/projects/commits/user_browses_commits_spec.rb
spec/features/projects/commits/user_browses_commits_spec.rb
+44
-0
No files found.
changelogs/unreleased/replace_spinach_user_lookup-feature.yml
0 → 100644
View file @
96e0020c
---
title
:
Replace 'project/user_lookup.feature' spinach test with an rspec analog
merge_request
:
13863
author
:
Vitaliy @blackst0ne Klachkov
type
:
other
features/project/commits/user_lookup.feature
deleted
100644 → 0
View file @
ef8eb3f6
@project_commits
Feature
:
Project Commits User Lookup
Background
:
Given
I sign in as a user
And
I own a project
And
I visit my project's commits page
Scenario
:
I
browse commit from list
Given
I have user with primary email
When
I click on commit link
Then
I see author based on primary email
Scenario
:
I
browse another commit from list
Given
I have user with secondary email
When
I click on another commit link
Then
I see author based on secondary email
features/steps/project/commits/user_lookup.rb
deleted
100644 → 0
View file @
ef8eb3f6
class
Spinach::Features::ProjectCommitsUserLookup
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedProject
include
SharedPaths
step
'I click on commit link'
do
visit
project_commit_path
(
@project
,
sample_commit
.
id
)
end
step
'I click on another commit link'
do
visit
project_commit_path
(
@project
,
sample_commit
.
parent_id
)
end
step
'I have user with primary email'
do
user_primary
end
step
'I have user with secondary email'
do
user_secondary
end
step
'I see author based on primary email'
do
check_author_link
(
sample_commit
.
author_email
,
user_primary
)
end
step
'I see author based on secondary email'
do
check_author_link
(
sample_commit
.
author_email
,
user_secondary
)
end
def
check_author_link
(
email
,
user
)
author_link
=
find
(
'.commit-author-link'
)
expect
(
author_link
[
'href'
]).
to
eq
user_path
(
user
)
expect
(
author_link
[
'title'
]).
to
eq
email
expect
(
find
(
'.commit-author-name'
).
text
).
to
eq
user
.
name
end
def
user_primary
@user_primary
||=
create
(
:user
,
email:
'dmitriy.zaporozhets@gmail.com'
)
end
def
user_secondary
@user_secondary
||=
begin
user
=
create
(
:user
,
email:
'dzaporozhets@example.com'
)
create
(
:email
,
{
user:
user
,
email:
'dmitriy.zaporozhets@gmail.com'
})
user
end
end
end
spec/features/projects/commit/rss_spec.rb
→
spec/features/projects/commit
s
/rss_spec.rb
View file @
96e0020c
File moved
spec/features/projects/commits/user_browses_commits_spec.rb
0 → 100644
View file @
96e0020c
require
'spec_helper'
describe
'User broweses commits'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
user
.
namespace
)
}
before
do
project
.
add_master
(
user
)
sign_in
(
user
)
end
context
'primary email'
do
it
'finds a commit by a primary email'
do
user
=
create
(
:user
,
email:
'dmitriy.zaporozhets@gmail.com'
)
visit
(
project_commit_path
(
project
,
RepoHelpers
.
sample_commit
.
id
))
check_author_link
(
RepoHelpers
.
sample_commit
.
author_email
,
user
)
end
end
context
'secondary email'
do
it
'finds a commit by a secondary email'
do
user
=
create
(
:user
)
do
|
user
|
create
(
:email
,
{
user:
user
,
email:
'dmitriy.zaporozhets@gmail.com'
})
end
visit
(
project_commit_path
(
project
,
RepoHelpers
.
sample_commit
.
parent_id
))
check_author_link
(
RepoHelpers
.
sample_commit
.
author_email
,
user
)
end
end
end
private
def
check_author_link
(
email
,
author
)
author_link
=
find
(
'.commit-author-link'
)
expect
(
author_link
[
'href'
]).
to
eq
(
user_path
(
author
))
expect
(
author_link
[
'title'
]).
to
eq
(
email
)
expect
(
find
(
'.commit-author-name'
).
text
).
to
eq
(
author
.
name
)
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