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
192c59e5
Commit
192c59e5
authored
Sep 01, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some tests for ff-only feature
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
2b51d4d8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
112 additions
and
19 deletions
+112
-19
features/project/ff_merge_requests.feature
features/project/ff_merge_requests.feature
+22
-0
features/project/merge_requests.feature
features/project/merge_requests.feature
+0
-9
features/steps/project/ff_merge_requests.rb
features/steps/project/ff_merge_requests.rb
+90
-0
features/steps/project/merge_requests.rb
features/steps/project/merge_requests.rb
+0
-10
No files found.
features/project/ff_merge_requests.feature
0 → 100644
View file @
192c59e5
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
ff merge enabled
And
merge request
"Bug NS-05"
is mergeable
Scenario
:
I
do ff-only merge
Given
merge request
"Bug NS-05"
is rebased
When
I visit merge request page
"Bug NS-05"
Then
I should see ff-only merge button
Scenario
:
I
do rebase before ff-only merge
Given
rebase before merge enabled
When
I visit merge request page
"Bug NS-05"
Then
I should see rebase button
Scenario
:
I
should do rebase before ff-only merge
When
I visit merge request page
"Bug NS-05"
Then
I should not see rebase button
And
I should see rebase message
features/project/merge_requests.feature
View file @
192c59e5
...
...
@@ -269,12 +269,3 @@ Feature: Project Merge Requests
And
I select
"fix"
as source
Then
I see auto-suggested approver
And
I can add it to approver list
Scenario
:
I
should see rebase checkbox
Given
project
"Shop"
have
"Bug NS-05"
open merge request with diffs inside
And
rebase before merge enabled
And
merge request
"Bug NS-05"
is mergeable
And
I visit merge request page
"Bug NS-05"
And
merge request is mergeable
Then
I should see rebase checkbox
features/steps/project/ff_merge_requests.rb
0 → 100644
View file @
192c59e5
class
Spinach::Features::ProjectFfMergeRequests
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedIssuable
include
SharedProject
include
SharedNote
include
SharedPaths
include
SharedMarkdown
include
SharedDiffNote
include
SharedUser
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
'merge request is mergeable'
do
expect
(
page
).
to
have_button
'Accept Merge Request'
end
step
'I should see ff-only merge button'
do
expect
(
page
).
to
have_content
"Fast-forward merge without creating merge commit"
expect
(
page
).
to
have_button
'Accept Merge Request'
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
"Accept Merge Request"
end
end
step
'I should see merged request'
do
page
.
within
'.issue-box'
do
expect
(
page
).
to
have_content
"Merged"
end
end
step
'ff merge enabled'
do
project
=
merge_request
.
target_project
project
.
merge_requests_ff_only_enabled
=
true
project
.
save!
end
step
'I should not see rebase button'
do
expect
(
page
).
to_not
have_button
"Rebase"
end
step
'I should see rebase button'
do
expect
(
page
).
to
have_button
"Rebase"
end
step
'I should see rebase message'
do
expect
(
page
).
to
have_content
"Fast-forward merge is not possible. Branch must be rebased first"
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_code
merge_request
.
save!
end
step
'rebase before merge enabled'
do
project
=
merge_request
.
target_project
project
.
merge_requests_rebase_enabled
=
true
project
.
save!
end
step
'I click on "Email Patches"'
do
click_link
"Email Patches"
end
step
'I click on "Plain Diff"'
do
click_link
"Plain Diff"
end
step
'I should see a patch diff'
do
expect
(
page
).
to
have_content
(
'diff --git'
)
end
def
merge_request
@merge_request
||=
MergeRequest
.
find_by!
(
title:
"Bug NS-05"
)
end
end
features/steps/project/merge_requests.rb
View file @
192c59e5
...
...
@@ -432,16 +432,6 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
end
step
'rebase before merge enabled'
do
project
=
merge_request
.
target_project
project
.
merge_requests_rebase_enabled
=
true
project
.
save!
end
step
'I should see rebase checkbox'
do
expect
(
page
).
to
have_content
'Rebase before merge'
end
step
'I click on "Email Patches"'
do
click_link
"Email Patches"
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