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
b77f2e45
Commit
b77f2e45
authored
Dec 14, 2016
by
Bryce Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add integration tests for unapprove.
parent
94399b59
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
64 deletions
+34
-64
spec/features/merge_requests/approvals_spec.rb
spec/features/merge_requests/approvals_spec.rb
+34
-41
spec/javascripts/merge_request_widget/approval_api_spec.js.es6
...javascripts/merge_request_widget/approval_api_spec.js.es6
+0
-23
No files found.
spec/features/merge_requests/approvals_spec.rb
View file @
b77f2e45
...
...
@@ -161,68 +161,61 @@ feature 'Merge request approvals', js: true, feature: true do
login_as
(
user
)
end
context
'when group is assigned to a project'
do
it
'I am able to approve'
do
create
:approver_group
,
group:
group
,
target:
project
context
'when group is assigned to a project'
,
js
:true
,
focus:
true
do
before
do
create
:approver_group
,
group:
group
,
target:
project
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
end
page
.
within
'.mr-state-widget'
do
click_button
'Approve Merge Request'
end
it
'I am able to approve'
do
approve_merge_request
expect
(
page
).
to
have_content
(
"Approved by"
)
end
it
'I am able to unapprove'
do
approve_merge_request
unapprove_merge_request
expect
(
page
).
not_to
have_content
(
"Approved by"
)
end
end
context
'when group is assigned to a merge request'
do
it
'I am able to approve'
do
context
'when group is assigned to a merge request'
,
js
:true
,
focus
:true
do
before
do
create
:approver_group
,
group:
group
,
target:
merge_request
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
end
it
'I am able to approve'
do
approve_merge_request
page
.
within
'.mr-state-widget'
do
click_button
'Approve Merge Request'
end
wait_for_ajax
expect
(
page
).
to
have_content
(
"Approved by"
)
end
end
end
context
'Unapproving by approvers from groups'
do
let
(
:other_user
)
{
create
(
:user
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
)
}
let
(
:group
)
{
create
:group
}
before
do
project
.
team
<<
[
user
,
:developer
]
group
.
add_developer
(
other_user
)
group
.
add_developer
(
user
)
login_as
(
user
)
create
:approver_group
,
group:
group
,
target:
project
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
page
.
within
'.mr-state-widget'
do
click_button
'Approve Merge Request'
it
'I am able to unapprove'
do
approve_merge_request
unapprove_merge_request
expect
(
page
).
not_to
have_content
(
"Approved by"
)
end
wait_for_ajax
end
end
end
it
'I am able to unapprove'
do
page
.
within
'.mr-state-widget'
do
click_button
'Remove your approval'
end
expect
(
page
).
not_to
have_content
(
"Approved by"
)
def
approve_merge_request
page
.
within
'.mr-state-widget'
do
click_button
'Approve Merge Request'
end
wait_for_ajax
end
end
def
unapprove_merge_request
page
.
within
'.mr-state-widget'
do
click_button
'Remove your approval'
end
wait_for_ajax
end
spec/javascripts/merge_request_widget/approval_api_spec.js.es6
deleted
100644 → 0
View file @
94399b59
/* eslint-disable */
//= require jquery
//= require vue
//= require issuable_time_tracker
((gl) => {
describe('Merge Request Approvals API', function() {
describe('Unapprove', function() {
method is defined
calls update state
});
describe('Approve', function() {
method is defined
calls update state
});
describe('Fetch', function() {
method is defined
calls update state
});
});
})(window.gl || (window.gl = {}));
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