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
c34bdec9
Commit
c34bdec9
authored
Mar 05, 2019
by
Kamil Trzciński
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix spec/finders/merge_requests_finder_spec.rb broken merge
parent
42b0fe20
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
5 deletions
+26
-5
spec/finders/merge_requests_finder_spec.rb
spec/finders/merge_requests_finder_spec.rb
+26
-5
No files found.
spec/finders/merge_requests_finder_spec.rb
View file @
c34bdec9
...
...
@@ -63,11 +63,32 @@ describe MergeRequestsFinder do
expect
(
merge_requests
.
size
).
to
eq
(
7
)
end
it
'ignores sorting by weight'
do
params
=
{
project_id:
project1
.
id
,
scope:
'authored'
,
state:
'opened'
,
weight:
Issue
::
WEIGHT_ANY
}
merge_requests
=
described_class
.
new
(
user
,
params
).
execute
expect
(
merge_requests
.
size
).
to
eq
(
2
)
end
it
'ignores sorting by weight'
do
params
=
{
project_id:
project1
.
id
,
scope:
'authored'
,
state:
'opened'
,
weight:
Issue
::
WEIGHT_ANY
}
merge_requests
=
described_class
.
new
(
user
,
params
).
execute
expect
(
merge_requests
.
size
).
to
eq
(
2
)
end
it
'filters by project'
do
params
=
{
project_id:
project1
.
id
,
scope:
'authored'
,
state:
'opened'
}
merge_requests
=
described_class
.
new
(
user
,
params
).
execute
expect
(
merge_requests
.
size
).
to
eq
(
2
)
end
it
'filters by commit sha'
do
merge_requests
=
described_class
.
new
(
user
,
commit_sha:
merge_request5
.
merge_request_diff
.
last_commit_sha
).
execute
expect
(
merge_requests
).
to
contain_exactly
(
merge_request5
)
end
context
'filtering by group'
do
it
'includes all merge requests when user has access'
do
params
=
{
group_id:
group
.
id
}
merge_requests
=
described_class
.
new
(
user
,
params
).
execute
expect
(
merge_requests
.
size
).
to
eq
(
3
)
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