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
Boxiang Sun
gitlab-ce
Commits
4b7a3d0c
Commit
4b7a3d0c
authored
Nov 16, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add feature spec for sort functionality on group/project members list
parent
7783267d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
164 additions
and
0 deletions
+164
-0
spec/features/groups/members/sorting_spec.rb
spec/features/groups/members/sorting_spec.rb
+82
-0
spec/features/projects/members/sorting_spec.rb
spec/features/projects/members/sorting_spec.rb
+82
-0
No files found.
spec/features/groups/members/sorting_spec.rb
0 → 100644
View file @
4b7a3d0c
require
'spec_helper'
feature
'Groups > Members > Sorting'
,
feature:
true
do
let
(
:owner
)
{
create
(
:user
,
name:
'John Doe'
)
}
let
(
:developer
)
{
create
(
:user
,
name:
'Mary Jane'
,
last_sign_in_at:
5
.
days
.
ago
)
}
let
(
:group
)
{
create
(
:group
)
}
background
do
group
.
add_owner
(
owner
)
group
.
add_developer
(
developer
)
login_as
(
owner
)
end
scenario
'sorts by access level ascending'
do
visit_members_list
(
sort: :access_level_asc
)
expect
(
first_member
).
to
include
(
developer
.
name
)
expect
(
second_member
).
to
include
(
owner
.
name
)
end
scenario
'sorts by access level descending'
do
visit_members_list
(
sort: :access_level_desc
)
expect
(
first_member
).
to
include
(
owner
.
name
)
expect
(
second_member
).
to
include
(
developer
.
name
)
end
scenario
'sorts by last joined'
do
visit_members_list
(
sort: :last_joined
)
expect
(
first_member
).
to
include
(
developer
.
name
)
expect
(
second_member
).
to
include
(
owner
.
name
)
end
scenario
'sorts by oldest joined'
do
visit_members_list
(
sort: :oldest_joined
)
expect
(
first_member
).
to
include
(
owner
.
name
)
expect
(
second_member
).
to
include
(
developer
.
name
)
end
scenario
'sorts by name ascending'
do
visit_members_list
(
sort: :name_asc
)
expect
(
first_member
).
to
include
(
owner
.
name
)
expect
(
second_member
).
to
include
(
developer
.
name
)
end
scenario
'sorts by name descending'
do
visit_members_list
(
sort: :name_desc
)
expect
(
first_member
).
to
include
(
developer
.
name
)
expect
(
second_member
).
to
include
(
owner
.
name
)
end
scenario
'sorts by recent sign in'
do
visit_members_list
(
sort: :recent_sign_in
)
expect
(
first_member
).
to
include
(
owner
.
name
)
expect
(
second_member
).
to
include
(
developer
.
name
)
end
scenario
'sorts by oldest sign in'
do
visit_members_list
(
sort: :oldest_sign_in
)
expect
(
first_member
).
to
include
(
developer
.
name
)
expect
(
second_member
).
to
include
(
owner
.
name
)
end
def
visit_members_list
(
sort
:)
visit
group_group_members_path
(
group
.
to_param
,
sort:
sort
)
end
def
first_member
page
.
all
(
'ul.content-list > li'
).
first
.
text
end
def
second_member
page
.
all
(
'ul.content-list > li'
).
last
.
text
end
end
spec/features/projects/members/sorting_spec.rb
0 → 100644
View file @
4b7a3d0c
require
'spec_helper'
feature
'Projects > Members > Sorting'
,
feature:
true
do
let
(
:master
)
{
create
(
:user
,
name:
'John Doe'
)
}
let
(
:developer
)
{
create
(
:user
,
name:
'Mary Jane'
,
last_sign_in_at:
5
.
days
.
ago
)
}
let
(
:project
)
{
create
(
:empty_project
)
}
background
do
project
.
team
<<
[
master
,
:master
]
project
.
team
<<
[
developer
,
:developer
]
login_as
(
master
)
end
scenario
'sorts by access level ascending'
do
visit_members_list
(
sort: :access_level_asc
)
expect
(
first_member
).
to
include
(
developer
.
name
)
expect
(
second_member
).
to
include
(
master
.
name
)
end
scenario
'sorts by access level descending'
do
visit_members_list
(
sort: :access_level_desc
)
expect
(
first_member
).
to
include
(
master
.
name
)
expect
(
second_member
).
to
include
(
developer
.
name
)
end
scenario
'sorts by last joined'
do
visit_members_list
(
sort: :last_joined
)
expect
(
first_member
).
to
include
(
developer
.
name
)
expect
(
second_member
).
to
include
(
master
.
name
)
end
scenario
'sorts by oldest joined'
do
visit_members_list
(
sort: :oldest_joined
)
expect
(
first_member
).
to
include
(
master
.
name
)
expect
(
second_member
).
to
include
(
developer
.
name
)
end
scenario
'sorts by name ascending'
do
visit_members_list
(
sort: :name_asc
)
expect
(
first_member
).
to
include
(
master
.
name
)
expect
(
second_member
).
to
include
(
developer
.
name
)
end
scenario
'sorts by name descending'
do
visit_members_list
(
sort: :name_desc
)
expect
(
first_member
).
to
include
(
developer
.
name
)
expect
(
second_member
).
to
include
(
master
.
name
)
end
scenario
'sorts by recent sign in'
do
visit_members_list
(
sort: :recent_sign_in
)
expect
(
first_member
).
to
include
(
master
.
name
)
expect
(
second_member
).
to
include
(
developer
.
name
)
end
scenario
'sorts by oldest sign in'
do
visit_members_list
(
sort: :oldest_sign_in
)
expect
(
first_member
).
to
include
(
developer
.
name
)
expect
(
second_member
).
to
include
(
master
.
name
)
end
def
visit_members_list
(
sort
:)
visit
namespace_project_project_members_path
(
project
.
namespace
.
to_param
,
project
.
to_param
,
sort:
sort
)
end
def
first_member
page
.
all
(
'ul.content-list > li'
).
first
.
text
end
def
second_member
page
.
all
(
'ul.content-list > li'
).
last
.
text
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