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
Léo-Paul Géneau
gitlab-ce
Commits
da31584d
Commit
da31584d
authored
Sep 11, 2017
by
blackst0ne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace the 'project/merge_requests/accept.feature' spinach test with an rspec analog
parent
ce14fae5
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
83 deletions
+70
-83
changelogs/unreleased/replace_project_merge_requests_accept-feature.yml
...eleased/replace_project_merge_requests_accept-feature.yml
+5
-0
features/project/merge_requests/accept.feature
features/project/merge_requests/accept.feature
+0
-28
features/steps/project/merge_requests/acceptance.rb
features/steps/project/merge_requests/acceptance.rb
+0
-55
spec/features/projects/merge_requests/user_accepts_merge_request_spec.rb
...rojects/merge_requests/user_accepts_merge_request_spec.rb
+65
-0
No files found.
changelogs/unreleased/replace_project_merge_requests_accept-feature.yml
0 → 100644
View file @
da31584d
---
title
:
Replace the 'project/merge_requests/accept.feature' spinach test with an rspec analog
merge_request
:
14176
author
:
Vitaliy @blackst0ne Klachkov
type
:
other
features/project/merge_requests/accept.feature
deleted
100644 → 0
View file @
ce14fae5
@project_merge_requests
Feature
:
Project Merge Requests Acceptance
Background
:
Given
There is an open Merge Request
And
I am signed in as a developer of the project
@javascript
Scenario
:
Accepting the Merge Request and removing the source branch
Given
I am on the Merge Request detail page
When
I check the
"Remove source branch"
option
And
I click on Accept Merge Request
Then
I should see merge request merged
And
I should not see the Remove Source Branch button
@javascript
Scenario
:
Accepting the Merge Request when URL has an anchor
Given
I am on the Merge Request detail with note anchor page
When
I check the
"Remove source branch"
option
And
I click on Accept Merge Request
Then
I should see merge request merged
And
I should not see the Remove Source Branch button
@javascript
Scenario
:
Accepting the Merge Request without removing the source branch
Given
I am on the Merge Request detail page
When
I click on Accept Merge Request
Then
I should see merge request merged
And
I should see the Remove Source Branch button
features/steps/project/merge_requests/acceptance.rb
deleted
100644 → 0
View file @
ce14fae5
class
Spinach::Features::ProjectMergeRequestsAcceptance
<
Spinach
::
FeatureSteps
include
LoginHelpers
include
WaitForRequests
step
'I am on the Merge Request detail page'
do
visit
merge_request_path
(
@merge_request
)
end
step
'I am on the Merge Request detail with note anchor page'
do
visit
merge_request_path
(
@merge_request
,
anchor:
'note_123'
)
end
step
'I uncheck the "Remove source branch" option'
do
uncheck
(
'Remove source branch'
)
end
step
'I check the "Remove source branch" option'
do
check
(
'Remove source branch'
)
end
step
'I click on Accept Merge Request'
do
click_button
(
'Merge'
)
end
step
'I should see the Remove Source Branch button'
do
expect
(
page
).
to
have_selector
(
'.js-remove-branch-button'
)
# Wait for View Resource requests to complete so they don't blow up if they are
# only handled after `DatabaseCleaner` has already run
wait_for_requests
end
step
'I should not see the Remove Source Branch button'
do
expect
(
page
).
not_to
have_selector
(
'.js-remove-branch-button'
)
# Wait for View Resource requests to complete so they don't blow up if they are
# only handled after `DatabaseCleaner` has already run
wait_for_requests
end
step
'There is an open Merge Request'
do
@user
=
create
(
:user
)
@project
=
create
(
:project
,
:public
,
:repository
)
@project_member
=
create
(
:project_member
,
:developer
,
user:
@user
,
project:
@project
)
@merge_request
=
create
(
:merge_request
,
:with_diffs
,
:simple
,
source_project:
@project
)
end
step
'I am signed in as a developer of the project'
do
sign_in
(
@user
)
end
step
'I should see merge request merged'
do
expect
(
page
).
to
have_content
(
'The changes were merged into'
)
end
end
spec/features/projects/merge_requests/user_accepts_merge_request_spec.rb
0 → 100644
View file @
da31584d
require
'spec_helper'
describe
'User accepts a merge request'
,
:js
do
let
(
:merge_request
)
{
create
(
:merge_request
,
:with_diffs
,
:simple
,
source_project:
project
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:user
)
{
create
(
:user
)
}
before
do
project
.
add_developer
(
user
)
sign_in
(
user
)
end
context
'with removing the source branch'
do
before
do
visit
(
merge_request_path
(
merge_request
))
end
it
'accepts a merge request'
do
check
(
'Remove source branch'
)
click_button
(
'Merge'
)
expect
(
page
).
to
have_content
(
'The changes were merged into'
)
expect
(
page
).
not_to
have_selector
(
'.js-remove-branch-button'
)
# Wait for View Resource requests to complete so they don't blow up if they are
# only handled after `DatabaseCleaner` has already run.
wait_for_requests
end
end
context
'without removing the source branch'
do
before
do
visit
(
merge_request_path
(
merge_request
))
end
it
'accepts a merge request'
do
click_button
(
'Merge'
)
expect
(
page
).
to
have_content
(
'The changes were merged into'
)
expect
(
page
).
to
have_selector
(
'.js-remove-branch-button'
)
# Wait for View Resource requests to complete so they don't blow up if they are
# only handled after `DatabaseCleaner` has already run
wait_for_requests
end
end
context
'when a URL has an anchor'
do
before
do
visit
(
merge_request_path
(
merge_request
,
anchor:
'note_123'
))
end
it
'accepts a merge request'
do
check
(
'Remove source branch'
)
click_button
(
'Merge'
)
expect
(
page
).
to
have_content
(
'The changes were merged into'
)
expect
(
page
).
not_to
have_selector
(
'.js-remove-branch-button'
)
# Wait for View Resource requests to complete so they don't blow up if they are
# only handled after `DatabaseCleaner` has already run
wait_for_requests
end
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