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
e091352b
Commit
e091352b
authored
Mar 08, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added rspec test to test when user cant merge
parent
28155c95
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
spec/features/merge_request/user_sees_merge_widget_spec.rb
spec/features/merge_request/user_sees_merge_widget_spec.rb
+24
-0
No files found.
spec/features/merge_request/user_sees_merge_widget_spec.rb
View file @
e091352b
require
'rails_helper'
describe
'Merge request > User sees merge widget'
,
:js
do
include
ProjectForksHelper
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:project_only_mwps
)
{
create
(
:project
,
:repository
,
only_allow_merge_if_pipeline_succeeds:
true
)
}
let
(
:user
)
{
project
.
creator
}
...
...
@@ -289,6 +291,28 @@ describe 'Merge request > User sees merge widget', :js do
end
end
context
'user cannot merge project and cannot push to fork'
,
:js
do
let
(
:forked_project
)
{
fork_project
(
project
,
nil
,
repository:
true
)
}
let
(
:user2
)
{
create
(
:user
)
}
before
do
project
.
add_developer
(
user2
)
sign_out
(
:user
)
sign_in
(
user2
)
merge_request
.
update
(
source_project:
forked_project
,
target_project:
project
,
merge_params:
{
'force_remove_source_branch'
=>
'1'
}
)
visit
project_merge_request_path
(
project
,
merge_request
)
end
it
'user cannot remove source branch'
do
expect
(
page
).
not_to
have_field
(
'remove-source-branch-input'
)
expect
(
page
).
to
have_content
(
'Removes source branch'
)
end
end
context
'ongoing merge process'
do
it
'shows Merging state'
do
allow_any_instance_of
(
MergeRequest
).
to
receive
(
:merge_ongoing?
).
and_return
(
true
)
...
...
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