BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
e091352b
Unverified
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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
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