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
1468dff1
Commit
1468dff1
authored
Aug 07, 2020
by
Robert May
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust specs to cover new location
parent
6821f942
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
21 deletions
+3
-21
ee/spec/requests/api/merge_request_approvals_spec.rb
ee/spec/requests/api/merge_request_approvals_spec.rb
+1
-0
lib/api/entities/merge_request_approvals.rb
lib/api/entities/merge_request_approvals.rb
+0
-4
spec/lib/api/entities/merge_request_approvals_spec.rb
spec/lib/api/entities/merge_request_approvals_spec.rb
+2
-4
spec/requests/api/merge_request_approvals_spec.rb
spec/requests/api/merge_request_approvals_spec.rb
+0
-13
No files found.
ee/spec/requests/api/merge_request_approvals_spec.rb
View file @
1468dff1
...
...
@@ -174,6 +174,7 @@ RSpec.describe API::MergeRequestApprovals do
expect
(
rule_response
[
'name'
]).
to
eq
(
'foo'
)
expect
(
rule_response
[
'approvers'
][
0
][
'username'
]).
to
eq
(
approver
.
username
)
expect
(
rule_response
[
'approved_by'
][
0
][
'username'
]).
to
eq
(
approver
.
username
)
expect
(
rule_response
[
'commented_by'
][
0
][
'username'
]).
to
eq
(
approver
.
username
)
expect
(
rule_response
[
'source_rule'
]).
to
be_nil
expect
(
rule_response
[
'section'
]).
to
be_nil
end
...
...
lib/api/entities/merge_request_approvals.rb
View file @
1468dff1
...
...
@@ -18,10 +18,6 @@ module API
expose
:approved_by
,
using:
::
API
::
Entities
::
Approvals
do
|
merge_request
|
merge_request
.
approvals
end
expose
:commented_by
,
using:
::
API
::
Entities
::
Approvals
do
|
merge_request
|
[]
end
end
end
end
spec/lib/api/entities/merge_request_approvals_spec.rb
View file @
1468dff1
...
...
@@ -21,8 +21,7 @@ RSpec.describe API::Entities::MergeRequestApprovals do
approved:
true
,
approved_by:
[{
user:
API
::
Entities
::
UserBasic
.
new
(
user
).
as_json
}],
commented_by:
[]
}]
})
end
...
...
@@ -31,8 +30,7 @@ RSpec.describe API::Entities::MergeRequestApprovals do
user_has_approved:
false
,
user_can_approve:
true
,
approved:
false
,
approved_by:
[],
commented_by:
[]
approved_by:
[]
})
end
end
spec/requests/api/merge_request_approvals_spec.rb
View file @
1468dff1
...
...
@@ -23,19 +23,6 @@ RSpec.describe API::MergeRequestApprovals do
end
end
describe
"GET :id/merge_requests/:merge_request_iid/approval_settings"
do
it
"retrieves the approval settings"
do
project
.
add_developer
(
approver
)
project
.
add_developer
(
create
(
:user
))
create
(
:approval
,
user:
approver
,
merge_request:
merge_request
)
get
api
(
"/projects/
#{
project
.
id
}
/merge_requests/
#{
merge_request
.
iid
}
/approval_settings"
,
user
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
end
describe
'POST :id/merge_requests/:merge_request_iid/approve'
do
context
'as a valid approver'
do
let_it_be
(
:approver
)
{
create
(
:user
)
}
...
...
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