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
9440b6a0
Commit
9440b6a0
authored
Jul 09, 2020
by
Samantha Ming
Committed by
Thong Kuah
Jul 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Feature spec for squash option edge cases mentioned in part 2
parent
629c7f77
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
spec/features/merge_request/user_edits_merge_request_spec.rb
spec/features/merge_request/user_edits_merge_request_spec.rb
+35
-0
No files found.
spec/features/merge_request/user_edits_merge_request_spec.rb
View file @
9440b6a0
...
...
@@ -17,6 +17,41 @@ RSpec.describe 'User edits a merge request', :js do
end
describe
'Squash commits'
do
it
'override MR setting if "Required" is saved'
do
merge_request
.
update!
(
squash:
false
)
project
.
project_setting
.
update!
(
squash_option:
'always'
)
visit
(
edit_project_merge_request_path
(
project
,
merge_request
))
click_button
(
'Save changes'
)
project
.
project_setting
.
update!
(
squash_option:
'default_off'
)
visit
(
edit_project_merge_request_path
(
project
,
merge_request
))
expect
(
find
(
"#merge_request_squash"
).
selected?
).
to
be
(
true
)
end
it
'recovers MR squash setting if "Required" is not saved'
do
merge_request
.
update!
(
squash:
false
)
project
.
project_setting
.
update!
(
squash_option:
'always'
)
visit
(
edit_project_merge_request_path
(
project
,
merge_request
))
project
.
project_setting
.
update!
(
squash_option:
'default_on'
)
visit
(
edit_project_merge_request_path
(
project
,
merge_request
))
expect
(
find
(
"#merge_request_squash"
).
selected?
).
to
be
(
false
)
end
it
'does not override MR squash setting if "Do not allow" is saved'
do
merge_request
.
update!
(
squash:
true
)
project
.
project_setting
.
update!
(
squash_option:
'never'
)
visit
(
edit_project_merge_request_path
(
project
,
merge_request
))
click_button
(
'Save changes'
)
expect
(
merge_request
.
squash
).
to
be
true
end
it
'displays "Required in this project" for "Required" project setting squash option'
do
project
.
project_setting
.
update!
(
squash_option:
'always'
)
visit
(
edit_project_merge_request_path
(
project
,
merge_request
))
...
...
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