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
d774fdd9
Commit
d774fdd9
authored
Oct 06, 2020
by
Igor Drozdov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move filter-by-approvals feature to FOSS
Filter-by-approvals feature belongs to FOSS, let's test it there
parent
8a5e9d54
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
90 additions
and
70 deletions
+90
-70
ee/spec/features/merge_requests/user_filters_by_approvers_spec.rb
...features/merge_requests/user_filters_by_approvers_spec.rb
+8
-70
spec/features/merge_requests/user_filters_by_approvals_spec.rb
...features/merge_requests/user_filters_by_approvals_spec.rb
+82
-0
No files found.
ee/spec/features/merge_requests/user_filters_by_approvers_spec.rb
View file @
d774fdd9
...
...
@@ -5,21 +5,21 @@ require 'spec_helper'
RSpec
.
describe
'Merge Requests > User filters'
,
:js
do
include
FilteredSearchHelpers
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:user
)
{
project
.
creator
}
let
(
:group_user
)
{
create
(
:user
)
}
let
(
:first_user
)
{
create
(
:user
)
}
let
_it_be
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
_it_be
(
:user
)
{
project
.
creator
}
let
_it_be
(
:group_user
)
{
create
(
:user
)
}
let
_it_be
(
:first_user
)
{
create
(
:user
)
}
let
!
(
:merge_request_with_approver
)
do
let
_it_be
(
:merge_request_with_approver
)
do
create
(
:merge_request
,
approval_users:
[
first_user
],
title:
'Bugfix1'
,
source_project:
project
,
source_branch:
'bugfix1'
)
end
let
!
(
:merge_request_with_two_approvers
)
do
let
_it_be
(
:merge_request_with_two_approvers
)
do
create
(
:merge_request
,
title:
'Bugfix2'
,
approval_users:
[
user
,
first_user
],
source_project:
project
,
source_branch:
'bugfix2'
)
end
let
!
(
:merge_request
)
{
create
(
:merge_request
,
title:
'Bugfix3'
,
source_project:
project
,
source_branch:
'bugfix3'
)
}
let
!
(
:merge_request_with_group_approver
)
do
let
_it_be
(
:merge_request
)
{
create
(
:merge_request
,
title:
'Bugfix3'
,
source_project:
project
,
source_branch:
'bugfix3'
)
}
let
_it_be
(
:merge_request_with_group_approver
)
do
group
=
create
(
:group
)
group
.
add_developer
(
group_user
)
...
...
@@ -97,66 +97,4 @@ RSpec.describe 'Merge Requests > User filters', :js do
end
end
end
context
'by "approved by"'
do
let!
(
:merge_request_with_first_user_approval
)
do
create
(
:merge_request
,
source_project:
project
,
title:
'Bugfix5'
).
tap
do
|
mr
|
create
(
:approval
,
merge_request:
mr
,
user:
first_user
)
end
end
let!
(
:merge_request_with_group_user_approved
)
do
group
=
create
(
:group
)
group
.
add_developer
(
group_user
)
create
(
:merge_request
,
source_project:
project
,
title:
'Bugfix6'
,
approval_groups:
[
group
],
source_branch:
'bugfix6'
).
tap
do
|
mr
|
create
(
:approval
,
merge_request:
mr
,
user:
group_user
)
end
end
context
'filtering by approved-by:none'
do
it
'applies the filter'
do
input_filtered_search
(
'approved-by:=none'
)
expect
(
page
).
to
have_issuable_counts
(
open:
4
,
closed:
0
,
all:
4
)
expect
(
page
).
not_to
have_content
'Bugfix5'
expect
(
page
).
to
have_content
'Bugfix3'
end
end
context
'filtering by approved-by:any'
do
it
'applies the filter'
do
input_filtered_search
(
'approved-by:=any'
)
expect
(
page
).
to
have_issuable_counts
(
open:
2
,
closed:
0
,
all:
2
)
expect
(
page
).
to
have_content
'Bugfix5'
expect
(
page
).
not_to
have_content
'Bugfix3'
end
end
context
'filtering by approved-by:@username'
do
it
'applies the filter'
do
input_filtered_search
(
"approved-by:=@
#{
first_user
.
username
}
"
)
expect
(
page
).
to
have_issuable_counts
(
open:
1
,
closed:
0
,
all:
1
)
expect
(
page
).
to
have_content
'Bugfix5'
expect
(
page
).
not_to
have_content
'Bugfix3'
end
end
context
'filtering by an approver from a group'
do
it
'applies the filter'
do
input_filtered_search
(
"approved-by:=@
#{
group_user
.
username
}
"
)
expect
(
page
).
to
have_issuable_counts
(
open:
1
,
closed:
0
,
all:
1
)
expect
(
page
).
to
have_content
'Bugfix6'
expect
(
page
).
not_to
have_content
'Bugfix5'
expect
(
page
).
not_to
have_content
'Bugfix3'
end
end
end
end
spec/features/merge_requests/user_filters_by_approvals_spec.rb
0 → 100644
View file @
d774fdd9
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
'Merge Requests > User filters'
,
:js
do
include
FilteredSearchHelpers
let_it_be
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
let_it_be
(
:user
)
{
project
.
creator
}
let_it_be
(
:group_user
)
{
create
(
:user
)
}
let_it_be
(
:first_user
)
{
create
(
:user
)
}
before
do
sign_in
(
user
)
visit
project_merge_requests_path
(
project
)
end
context
'by "approved by"'
do
let_it_be
(
:merge_request
)
{
create
(
:merge_request
,
title:
'Bugfix3'
,
source_project:
project
,
source_branch:
'bugfix3'
)
}
let_it_be
(
:merge_request_with_first_user_approval
)
do
create
(
:merge_request
,
source_project:
project
,
title:
'Bugfix5'
).
tap
do
|
mr
|
create
(
:approval
,
merge_request:
mr
,
user:
first_user
)
end
end
let_it_be
(
:merge_request_with_group_user_approved
)
do
group
=
create
(
:group
)
group
.
add_developer
(
group_user
)
create
(
:merge_request
,
source_project:
project
,
title:
'Bugfix6'
,
source_branch:
'bugfix6'
).
tap
do
|
mr
|
create
(
:approval
,
merge_request:
mr
,
user:
group_user
)
end
end
context
'filtering by approved-by:none'
do
it
'applies the filter'
do
input_filtered_search
(
'approved-by:=none'
)
expect
(
page
).
to
have_issuable_counts
(
open:
1
,
closed:
0
,
all:
1
)
expect
(
page
).
not_to
have_content
'Bugfix5'
expect
(
page
).
not_to
have_content
'Bugfix6'
expect
(
page
).
to
have_content
'Bugfix3'
end
end
context
'filtering by approved-by:any'
do
it
'applies the filter'
do
input_filtered_search
(
'approved-by:=any'
)
expect
(
page
).
to
have_issuable_counts
(
open:
2
,
closed:
0
,
all:
2
)
expect
(
page
).
to
have_content
'Bugfix5'
expect
(
page
).
not_to
have_content
'Bugfix3'
end
end
context
'filtering by approved-by:@username'
do
it
'applies the filter'
do
input_filtered_search
(
"approved-by:=@
#{
first_user
.
username
}
"
)
expect
(
page
).
to
have_issuable_counts
(
open:
1
,
closed:
0
,
all:
1
)
expect
(
page
).
to
have_content
'Bugfix5'
expect
(
page
).
not_to
have_content
'Bugfix3'
end
end
context
'filtering by an approver from a group'
do
it
'applies the filter'
do
input_filtered_search
(
"approved-by:=@
#{
group_user
.
username
}
"
)
expect
(
page
).
to
have_issuable_counts
(
open:
1
,
closed:
0
,
all:
1
)
expect
(
page
).
to
have_content
'Bugfix6'
expect
(
page
).
not_to
have_content
'Bugfix5'
expect
(
page
).
not_to
have_content
'Bugfix3'
end
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