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
e4e39814
Commit
e4e39814
authored
May 08, 2017
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace wait_for_ajax with wait_for_vue_resource on approvals spec
parent
a6385088
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
spec/features/merge_requests/approvals_spec.rb
spec/features/merge_requests/approvals_spec.rb
+10
-10
No files found.
spec/features/merge_requests/approvals_spec.rb
View file @
e4e39814
require
'rails_helper'
require
'rails_helper'
feature
'Merge request approvals'
,
js:
true
,
feature:
true
do
feature
'Merge request approvals'
,
js:
true
,
feature:
true
do
include
WaitFor
Ajax
include
WaitFor
VueResource
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
approvals_before_merge:
1
)
}
let
(
:project
)
{
create
(
:project
,
approvals_before_merge:
1
)
}
...
@@ -74,7 +74,7 @@ feature 'Merge request approvals', js: true, feature: true do
...
@@ -74,7 +74,7 @@ feature 'Merge request approvals', js: true, feature: true do
visit
new_namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request:
{
target_branch:
'master'
,
source_branch:
'feature'
})
visit
new_namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request:
{
target_branch:
'master'
,
source_branch:
'feature'
})
find
(
'#s2id_merge_request_approver_group_ids .select2-input'
).
click
find
(
'#s2id_merge_request_approver_group_ids .select2-input'
).
click
wait_for_
ajax
wait_for_
vue_resource
expect
(
find
(
'.select2-results'
)).
to
have_content
(
group
.
name
)
expect
(
find
(
'.select2-results'
)).
to
have_content
(
group
.
name
)
...
@@ -103,7 +103,7 @@ feature 'Merge request approvals', js: true, feature: true do
...
@@ -103,7 +103,7 @@ feature 'Merge request approvals', js: true, feature: true do
click_on
(
"Submit merge request"
)
click_on
(
"Submit merge request"
)
wait_for_
ajax
wait_for_
vue_resource
expect
(
page
).
not_to
have_selector
(
".approvals-required-text a[title='
#{
other_user
.
name
}
']"
)
expect
(
page
).
not_to
have_selector
(
".approvals-required-text a[title='
#{
other_user
.
name
}
']"
)
expect
(
page
).
to
have_selector
(
".approvals-required-text a[title='
#{
approver
.
name
}
']"
)
expect
(
page
).
to
have_selector
(
".approvals-required-text a[title='
#{
approver
.
name
}
']"
)
...
@@ -129,14 +129,14 @@ feature 'Merge request approvals', js: true, feature: true do
...
@@ -129,14 +129,14 @@ feature 'Merge request approvals', js: true, feature: true do
visit
edit_namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
visit
edit_namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
find
(
'#s2id_merge_request_approver_group_ids .select2-input'
).
click
find
(
'#s2id_merge_request_approver_group_ids .select2-input'
).
click
wait_for_
ajax
wait_for_
vue_resource
expect
(
find
(
'.select2-results'
)).
to
have_content
(
group
.
name
)
expect
(
find
(
'.select2-results'
)).
to
have_content
(
group
.
name
)
find
(
'.select2-results'
).
click
find
(
'.select2-results'
).
click
click_on
(
"Save changes"
)
click_on
(
"Save changes"
)
wait_for_
ajax
wait_for_
vue_resource
find
(
'.approvals-components'
)
find
(
'.approvals-components'
)
expect
(
page
).
to
have_content
(
"Requires 1 more approval"
)
expect
(
page
).
to
have_content
(
"Requires 1 more approval"
)
end
end
...
@@ -236,7 +236,7 @@ feature 'Merge request approvals', js: true, feature: true do
...
@@ -236,7 +236,7 @@ feature 'Merge request approvals', js: true, feature: true do
it
'I am able to approve'
do
it
'I am able to approve'
do
approve_merge_request
approve_merge_request
wait_for_
ajax
wait_for_
vue_resource
expect
(
page
).
to
have_content
(
'Approved by'
)
expect
(
page
).
to
have_content
(
'Approved by'
)
expect
(
page
).
to
have_css
(
'.approver-avatar'
)
expect
(
page
).
to
have_css
(
'.approver-avatar'
)
end
end
...
@@ -259,7 +259,7 @@ feature 'Merge request approvals', js: true, feature: true do
...
@@ -259,7 +259,7 @@ feature 'Merge request approvals', js: true, feature: true do
# before approval status is loaded
# before approval status is loaded
expect
(
page
).
to
have_button
(
'Merge when pipeline succeeds'
,
disabled:
true
)
expect
(
page
).
to
have_button
(
'Merge when pipeline succeeds'
,
disabled:
true
)
wait_for_
ajax
wait_for_
vue_resource
# after approval status is loaded
# after approval status is loaded
expect
(
page
).
to
have_button
(
'Merge when pipeline succeeds'
,
disabled:
true
)
expect
(
page
).
to
have_button
(
'Merge when pipeline succeeds'
,
disabled:
true
)
...
@@ -285,7 +285,7 @@ feature 'Merge request approvals', js: true, feature: true do
...
@@ -285,7 +285,7 @@ feature 'Merge request approvals', js: true, feature: true do
# before approval status is loaded
# before approval status is loaded
expect
(
page
).
to
have_button
(
"Rebase"
,
disabled:
true
)
expect
(
page
).
to
have_button
(
"Rebase"
,
disabled:
true
)
wait_for_
ajax
wait_for_
vue_resource
# after approval status is loaded
# after approval status is loaded
expect
(
page
).
to
have_button
(
"Rebase"
,
disabled:
true
)
expect
(
page
).
to
have_button
(
"Rebase"
,
disabled:
true
)
...
@@ -320,12 +320,12 @@ def approve_merge_request
...
@@ -320,12 +320,12 @@ def approve_merge_request
page
.
within
'.mr-state-widget'
do
page
.
within
'.mr-state-widget'
do
find
(
'.approve-btn'
).
click
find
(
'.approve-btn'
).
click
end
end
wait_for_
ajax
wait_for_
vue_resource
end
end
def
unapprove_merge_request
def
unapprove_merge_request
page
.
within
'.mr-state-widget'
do
page
.
within
'.mr-state-widget'
do
find
(
'.unapprove-btn-wrap'
).
click
find
(
'.unapprove-btn-wrap'
).
click
end
end
wait_for_
ajax
wait_for_
vue_resource
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