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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
761b2e98
Commit
761b2e98
authored
Sep 19, 2017
by
Eric Eastwood
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port fast-foward spinach specs from EE
parent
1849336a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
89 additions
and
0 deletions
+89
-0
features/project/ff_merge_requests.feature
features/project/ff_merge_requests.feature
+24
-0
features/steps/project/ff_merge_requests.rb
features/steps/project/ff_merge_requests.rb
+65
-0
No files found.
features/project/ff_merge_requests.feature
0 → 100644
View file @
761b2e98
Feature
:
Project Ff Merge Requests
Background
:
Given
I sign in as a user
And
I own project
"Shop"
And
project
"Shop"
have
"Bug NS-05"
open merge request with diffs inside
And
merge request
"Bug NS-05"
is mergeable
@javascript
Scenario
:
I
do ff-only merge for rebased branch
Given
ff merge enabled
And
merge request
"Bug NS-05"
is rebased
When
I visit merge request page
"Bug NS-05"
Then
I should see ff-only merge button
When
I accept this merge request
Then
I should see merged request
@javascript
Scenario
:
I
do ff-only merge for merged branch
Given
ff merge enabled
And
merge request
"Bug NS-05"
merged target
When
I visit merge request page
"Bug NS-05"
Then
I should see ff-only merge button
When
I accept this merge request
Then
I should see merged request
features/steps/project/ff_merge_requests.rb
0 → 100644
View file @
761b2e98
class
Spinach::Features::ProjectFfMergeRequests
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedIssuable
include
SharedProject
include
SharedNote
include
SharedPaths
include
SharedMarkdown
include
SharedDiffNote
include
SharedUser
include
WaitForRequests
step
'project "Shop" have "Bug NS-05" open merge request with diffs inside'
do
create
(
:merge_request_with_diffs
,
title:
"Bug NS-05"
,
source_project:
project
,
target_project:
project
,
author:
project
.
users
.
first
)
end
step
'I should see ff-only merge button'
do
expect
(
page
).
to
have_content
"Fast-forward merge without a merge commit"
expect
(
page
).
to
have_button
'Merge'
end
step
'merge request "Bug NS-05" is mergeable'
do
merge_request
.
mark_as_mergeable
end
step
'I accept this merge request'
do
page
.
within
'.mr-state-widget'
do
click_button
"Merge"
end
end
step
'I should see merged request'
do
page
.
within
'.status-box'
do
expect
(
page
).
to
have_content
"Merged"
wait_for_requests
end
end
step
'ff merge enabled'
do
project
=
merge_request
.
target_project
project
.
merge_requests_ff_only_enabled
=
true
project
.
save!
end
step
'merge request "Bug NS-05" is rebased'
do
merge_request
.
source_branch
=
'flatten-dir'
merge_request
.
target_branch
=
'improve/awesome'
merge_request
.
reload_diff
merge_request
.
save!
end
step
'merge request "Bug NS-05" merged target'
do
merge_request
.
source_branch
=
'merged-target'
merge_request
.
target_branch
=
'improve/awesome'
merge_request
.
reload_diff
merge_request
.
save!
end
def
merge_request
@merge_request
||=
MergeRequest
.
find_by!
(
title:
"Bug NS-05"
)
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