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
b47244c1
Commit
b47244c1
authored
Apr 19, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for merge errors when automatic merge is enabled
parent
51ed8438
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
spec/features/merge_requests/widget_spec.rb
spec/features/merge_requests/widget_spec.rb
+44
-0
No files found.
spec/features/merge_requests/widget_spec.rb
View file @
b47244c1
...
...
@@ -141,6 +141,50 @@ describe 'Merge request', :feature, :js do
end
end
context
'view merge request with MWPS enabled but automatically merge fails'
do
before
do
merge_request
.
update
(
merge_when_pipeline_succeeds:
true
,
merge_user:
merge_request
.
author
,
merge_error:
'Something went wrong'
)
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
end
it
'shows information about the merge error'
do
# Wait for the `ci_status` and `merge_check` requests
wait_for_ajax
page
.
within
(
'.mr-widget-body'
)
do
expect
(
page
).
to
have_content
(
'Something went wrong'
)
end
end
end
context
'view merge request with MWPS enabled but fast-forward merge is not possible'
do
before
do
project
.
update
(
merge_requests_ff_only_enabled:
true
)
merge_request
.
update
(
merge_when_pipeline_succeeds:
true
,
merge_user:
merge_request
.
author
,
state: :can_be_merged
)
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
end
it
'shows information about the merge error'
do
# Wait for the `ci_status` and `merge_check` requests
wait_for_ajax
page
.
within
(
'.mr-widget-body'
)
do
expect
(
page
).
to
have_content
(
'Fast-forward merge is not possible'
)
end
end
end
context
'merge error'
do
before
do
allow_any_instance_of
(
Repository
).
to
receive
(
:merge
).
and_return
(
false
)
...
...
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