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
c607b358
Commit
c607b358
authored
Jan 09, 2019
by
Sam Bigelow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use 'delete' instead of 'remove' for source branch
This is to match `git branch -D <branchname>`
parent
1b3affaf
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
65 additions
and
63 deletions
+65
-63
app/assets/javascripts/vue_merge_request_widget/components/source_branch_removal_status.vue
...equest_widget/components/source_branch_removal_status.vue
+1
-1
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_merge_when_pipeline_succeeds.vue
...ponents/states/mr_widget_merge_when_pipeline_succeeds.vue
+3
-3
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_merged.vue
...rge_request_widget/components/states/mr_widget_merged.vue
+5
-5
app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue
...merge_request_widget/components/states/ready_to_merge.vue
+2
-2
app/services/delete_branch_service.rb
app/services/delete_branch_service.rb
+1
-1
app/views/projects/protected_branches/shared/_protected_branch.html.haml
...cts/protected_branches/shared/_protected_branch.html.haml
+1
-1
app/views/shared/issuable/form/_merge_params.html.haml
app/views/shared/issuable/form/_merge_params.html.haml
+1
-1
changelogs/unreleased/25569-changing-wording-to-delete-when-referring-to-removing-a-branch.yml
...wording-to-delete-when-referring-to-removing-a-branch.yml
+5
-0
lib/api/merge_requests.rb
lib/api/merge_requests.rb
+1
-1
locale/gitlab.pot
locale/gitlab.pot
+10
-13
spec/controllers/projects/branches_controller_spec.rb
spec/controllers/projects/branches_controller_spec.rb
+3
-3
spec/features/merge_request/user_accepts_merge_request_spec.rb
...features/merge_request/user_accepts_merge_request_spec.rb
+2
-2
spec/features/merge_request/user_merges_when_pipeline_succeeds_spec.rb
.../merge_request/user_merges_when_pipeline_succeeds_spec.rb
+5
-5
spec/features/merge_request/user_sees_merge_widget_spec.rb
spec/features/merge_request/user_sees_merge_widget_spec.rb
+1
-1
spec/features/merge_requests/user_squashes_merge_request_spec.rb
...atures/merge_requests/user_squashes_merge_request_spec.rb
+1
-1
spec/features/protected_branches_spec.rb
spec/features/protected_branches_spec.rb
+1
-1
spec/javascripts/vue_mr_widget/components/states/mr_widget_merge_when_pipeline_succeeds_spec.js
...nts/states/mr_widget_merge_when_pipeline_succeeds_spec.js
+7
-7
spec/javascripts/vue_mr_widget/components/states/mr_widget_merged_spec.js
.../vue_mr_widget/components/states/mr_widget_merged_spec.js
+10
-10
spec/javascripts/vue_mr_widget/mr_widget_options_spec.js
spec/javascripts/vue_mr_widget/mr_widget_options_spec.js
+3
-3
spec/support/shared_examples/features/editable_merge_request_shared_examples.rb
...amples/features/editable_merge_request_shared_examples.rb
+2
-2
No files found.
app/assets/javascripts/vue_merge_request_widget/components/source_branch_removal_status.vue
View file @
c607b358
...
@@ -7,7 +7,7 @@ export default {
...
@@ -7,7 +7,7 @@ export default {
tooltip
,
tooltip
,
},
},
created
()
{
created
()
{
this
.
removesBranchText
=
__
(
'
<strong>
Remov
es</strong> source branch
'
);
this
.
removesBranchText
=
__
(
'
<strong>
Delet
es</strong> source branch
'
);
this
.
tooltipTitle
=
__
(
'
A user with write access to the source branch selected this option
'
);
this
.
tooltipTitle
=
__
(
'
A user with write access to the source branch selected this option
'
);
},
},
};
};
...
...
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_merge_when_pipeline_succeeds.vue
View file @
c607b358
...
@@ -106,11 +106,11 @@ export default {
...
@@ -106,11 +106,11 @@ export default {
<a
:href=
"mr.targetBranchPath"
class=
"label-branch"
>
{{
mr
.
targetBranch
}}
</a>
<a
:href=
"mr.targetBranchPath"
class=
"label-branch"
>
{{
mr
.
targetBranch
}}
</a>
</p>
</p>
<p
v-if=
"mr.shouldRemoveSourceBranch"
>
<p
v-if=
"mr.shouldRemoveSourceBranch"
>
{{
s__
(
'
mrWidget|The source branch will be
remov
ed
'
)
}}
{{
s__
(
'
mrWidget|The source branch will be
delet
ed
'
)
}}
</p>
</p>
<p
v-else
class=
"d-flex align-items-start"
>
<p
v-else
class=
"d-flex align-items-start"
>
<span
class=
"append-right-10"
>
<span
class=
"append-right-10"
>
{{
s__
(
'
mrWidget|The source branch will not be
remov
ed
'
)
}}
{{
s__
(
'
mrWidget|The source branch will not be
delet
ed
'
)
}}
</span>
</span>
<a
<a
v-if=
"canRemoveSourceBranch"
v-if=
"canRemoveSourceBranch"
...
@@ -121,7 +121,7 @@ export default {
...
@@ -121,7 +121,7 @@ export default {
@
click.prevent=
"removeSourceBranch"
@
click.prevent=
"removeSourceBranch"
>
>
<i
v-if=
"isRemovingSourceBranch"
class=
"fa fa-spinner fa-spin"
aria-hidden=
"true"
>
</i>
<i
v-if=
"isRemovingSourceBranch"
class=
"fa fa-spinner fa-spin"
aria-hidden=
"true"
>
</i>
{{
s__
(
'
mrWidget|
Remov
e source branch
'
)
}}
{{
s__
(
'
mrWidget|
Delet
e source branch
'
)
}}
</a>
</a>
</p>
</p>
</section>
</section>
...
...
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_merged.vue
View file @
c607b358
...
@@ -84,7 +84,7 @@ export default {
...
@@ -84,7 +84,7 @@ export default {
.
removeSourceBranch
()
.
removeSourceBranch
()
.
then
(
res
=>
res
.
data
)
.
then
(
res
=>
res
.
data
)
.
then
(
data
=>
{
.
then
(
data
=>
{
if
(
data
.
message
===
'
Branch was
remov
ed
'
)
{
if
(
data
.
message
===
'
Branch was
delet
ed
'
)
{
eventHub
.
$emit
(
'
MRWidgetUpdateRequested
'
,
()
=>
{
eventHub
.
$emit
(
'
MRWidgetUpdateRequested
'
,
()
=>
{
this
.
isMakingRequest
=
false
;
this
.
isMakingRequest
=
false
;
});
});
...
@@ -174,22 +174,22 @@ export default {
...
@@ -174,22 +174,22 @@ export default {
</
template
>
</
template
>
</p>
</p>
<p
v-if=
"mr.sourceBranchRemoved"
>
<p
v-if=
"mr.sourceBranchRemoved"
>
{{ s__('mrWidget|The source branch has been
remov
ed') }}
{{ s__('mrWidget|The source branch has been
delet
ed') }}
</p>
</p>
<p
v-if=
"shouldShowRemoveSourceBranch"
class=
"space-children"
>
<p
v-if=
"shouldShowRemoveSourceBranch"
class=
"space-children"
>
<span>
{{ s__('mrWidget|You can
remov
e source branch now') }}
</span>
<span>
{{ s__('mrWidget|You can
delete th
e source branch now') }}
</span>
<button
<button
:disabled=
"isMakingRequest"
:disabled=
"isMakingRequest"
type=
"button"
type=
"button"
class=
"btn btn-sm btn-default js-remove-branch-button"
class=
"btn btn-sm btn-default js-remove-branch-button"
@
click=
"removeSourceBranch"
@
click=
"removeSourceBranch"
>
>
{{ s__('mrWidget|
Remove Source B
ranch') }}
{{ s__('mrWidget|
Delete source b
ranch') }}
</button>
</button>
</p>
</p>
<p
v-if=
"shouldShowSourceBranchRemoving"
>
<p
v-if=
"shouldShowSourceBranchRemoving"
>
<gl-loading-icon
:inline=
"true"
/>
<gl-loading-icon
:inline=
"true"
/>
<span>
{{ s__('mrWidget|The source branch is being
remov
ed') }}
</span>
<span>
{{ s__('mrWidget|The source branch is being
delet
ed') }}
</span>
</p>
</p>
</section>
</section>
</div>
</div>
...
...
app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue
View file @
c607b358
...
@@ -231,7 +231,7 @@ export default {
...
@@ -231,7 +231,7 @@ export default {
}
}
})
})
.
catch
(()
=>
{
.
catch
(()
=>
{
new
Flash
(
'
Something went wrong while
remov
ing the source branch. Please try again.
'
);
// eslint-disable-line
new
Flash
(
'
Something went wrong while
delet
ing the source branch. Please try again.
'
);
// eslint-disable-line
});
});
},
},
},
},
...
@@ -305,7 +305,7 @@ export default {
...
@@ -305,7 +305,7 @@ export default {
class=
"js-remove-source-branch-checkbox"
class=
"js-remove-source-branch-checkbox"
type=
"checkbox"
type=
"checkbox"
/>
/>
Remov
e source branch
Delet
e source branch
</label>
</label>
<!-- Placeholder for EE extension of this component -->
<!-- Placeholder for EE extension of this component -->
...
...
app/services/delete_branch_service.rb
View file @
c607b358
...
@@ -14,7 +14,7 @@ class DeleteBranchService < BaseService
...
@@ -14,7 +14,7 @@ class DeleteBranchService < BaseService
end
end
if
repository
.
rm_branch
(
current_user
,
branch_name
)
if
repository
.
rm_branch
(
current_user
,
branch_name
)
success
(
'Branch was
remov
ed'
)
success
(
'Branch was
delet
ed'
)
else
else
error
(
'Failed to remove branch'
)
error
(
'Failed to remove branch'
)
end
end
...
...
app/views/projects/protected_branches/shared/_protected_branch.html.haml
View file @
c607b358
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
=
link_to
(
commit
.
short_id
,
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
commit
.
id
),
class:
'commit-sha'
)
=
link_to
(
commit
.
short_id
,
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
commit
.
id
),
class:
'commit-sha'
)
=
time_ago_with_tooltip
(
commit
.
committed_date
)
=
time_ago_with_tooltip
(
commit
.
committed_date
)
-
else
-
else
(branch was
remov
ed from repository)
(branch was
delet
ed from repository)
=
yield
=
yield
...
...
app/views/shared/issuable/form/_merge_params.html.haml
View file @
c607b358
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
=
hidden_field_tag
'merge_request[force_remove_source_branch]'
,
'0'
,
id:
nil
=
hidden_field_tag
'merge_request[force_remove_source_branch]'
,
'0'
,
id:
nil
=
check_box_tag
'merge_request[force_remove_source_branch]'
,
'1'
,
issuable
.
force_remove_source_branch?
,
class:
'form-check-input'
=
check_box_tag
'merge_request[force_remove_source_branch]'
,
'1'
,
issuable
.
force_remove_source_branch?
,
class:
'form-check-input'
=
label_tag
'merge_request[force_remove_source_branch]'
,
class:
'form-check-label'
do
=
label_tag
'merge_request[force_remove_source_branch]'
,
class:
'form-check-label'
do
Remov
e source branch when merge request is accepted.
Delet
e source branch when merge request is accepted.
.form-group.row
.form-group.row
.col-sm-10.offset-sm-2
.col-sm-10.offset-sm-2
...
...
changelogs/unreleased/25569-changing-wording-to-delete-when-referring-to-removing-a-branch.yml
0 → 100644
View file @
c607b358
---
title
:
Use delete instead of remove when referring to `git branch -D`
merge_request
:
!23966
author
:
type
:
changed
lib/api/merge_requests.rb
View file @
c607b358
...
@@ -179,7 +179,7 @@ module API
...
@@ -179,7 +179,7 @@ module API
optional
:assignee_id
,
type:
Integer
,
desc:
'The ID of a user to assign the merge request'
optional
:assignee_id
,
type:
Integer
,
desc:
'The ID of a user to assign the merge request'
optional
:milestone_id
,
type:
Integer
,
desc:
'The ID of a milestone to assign the merge request'
optional
:milestone_id
,
type:
Integer
,
desc:
'The ID of a milestone to assign the merge request'
optional
:labels
,
type:
String
,
desc:
'Comma-separated list of label names'
optional
:labels
,
type:
String
,
desc:
'Comma-separated list of label names'
optional
:remove_source_branch
,
type:
Boolean
,
desc:
'
Remov
e source branch when merging'
optional
:remove_source_branch
,
type:
Boolean
,
desc:
'
Delet
e source branch when merging'
optional
:allow_collaboration
,
type:
Boolean
,
desc:
'Allow commits from members who can merge to the target branch'
optional
:allow_collaboration
,
type:
Boolean
,
desc:
'Allow commits from members who can merge to the target branch'
optional
:allow_maintainer_to_push
,
type:
Boolean
,
as: :allow_collaboration
,
desc:
'[deprecated] See allow_collaboration'
optional
:allow_maintainer_to_push
,
type:
Boolean
,
as: :allow_collaboration
,
desc:
'[deprecated] See allow_collaboration'
optional
:squash
,
type:
Grape
::
API
::
Boolean
,
desc:
'When true, the commits will be squashed into a single commit on merge'
optional
:squash
,
type:
Grape
::
API
::
Boolean
,
desc:
'When true, the commits will be squashed into a single commit on merge'
...
...
locale/gitlab.pot
View file @
c607b358
...
@@ -288,7 +288,7 @@ msgstr ""
...
@@ -288,7 +288,7 @@ msgstr ""
msgid "<strong>%{group_name}</strong> group members"
msgid "<strong>%{group_name}</strong> group members"
msgstr ""
msgstr ""
msgid "<strong>
Remov
es</strong> source branch"
msgid "<strong>
Delet
es</strong> source branch"
msgstr ""
msgstr ""
msgid "A 'Runner' is a process which runs a job. You can set up as many Runners as you need."
msgid "A 'Runner' is a process which runs a job. You can set up as many Runners as you need."
...
@@ -8118,6 +8118,9 @@ msgstr ""
...
@@ -8118,6 +8118,9 @@ msgstr ""
msgid "mrWidget|Create an issue to resolve them later"
msgid "mrWidget|Create an issue to resolve them later"
msgstr ""
msgstr ""
msgid "mrWidget|Delete source branch"
msgstr ""
msgid "mrWidget|Deployment statistics are not available currently"
msgid "mrWidget|Deployment statistics are not available currently"
msgstr ""
msgstr ""
...
@@ -8178,12 +8181,6 @@ msgstr ""
...
@@ -8178,12 +8181,6 @@ msgstr ""
msgid "mrWidget|Refreshing now"
msgid "mrWidget|Refreshing now"
msgstr ""
msgstr ""
msgid "mrWidget|Remove Source Branch"
msgstr ""
msgid "mrWidget|Remove source branch"
msgstr ""
msgid "mrWidget|Request to merge"
msgid "mrWidget|Request to merge"
msgstr ""
msgstr ""
...
@@ -8217,19 +8214,19 @@ msgstr ""
...
@@ -8217,19 +8214,19 @@ msgstr ""
msgid "mrWidget|The source branch HEAD has recently changed. Please reload the page and review the changes before merging"
msgid "mrWidget|The source branch HEAD has recently changed. Please reload the page and review the changes before merging"
msgstr ""
msgstr ""
msgid "mrWidget|The source branch has been
remov
ed"
msgid "mrWidget|The source branch has been
delet
ed"
msgstr ""
msgstr ""
msgid "mrWidget|The source branch is %{commitsBehindLinkStart}%{commitsBehind}%{commitsBehindLinkEnd} the target branch"
msgid "mrWidget|The source branch is %{commitsBehindLinkStart}%{commitsBehind}%{commitsBehindLinkEnd} the target branch"
msgstr ""
msgstr ""
msgid "mrWidget|The source branch is being
remov
ed"
msgid "mrWidget|The source branch is being
delet
ed"
msgstr ""
msgstr ""
msgid "mrWidget|The source branch will be
remov
ed"
msgid "mrWidget|The source branch will be
delet
ed"
msgstr ""
msgstr ""
msgid "mrWidget|The source branch will not be
remov
ed"
msgid "mrWidget|The source branch will not be
delet
ed"
msgstr ""
msgstr ""
msgid "mrWidget|There are merge conflicts"
msgid "mrWidget|There are merge conflicts"
...
@@ -8253,10 +8250,10 @@ msgstr ""
...
@@ -8253,10 +8250,10 @@ msgstr ""
msgid "mrWidget|You are not allowed to edit this project directly. Please fork to make changes."
msgid "mrWidget|You are not allowed to edit this project directly. Please fork to make changes."
msgstr ""
msgstr ""
msgid "mrWidget|You can
merge this merge request manually using the
"
msgid "mrWidget|You can
delete the source branch now
"
msgstr ""
msgstr ""
msgid "mrWidget|You can
remove source branch now
"
msgid "mrWidget|You can
merge this merge request manually using the
"
msgstr ""
msgstr ""
msgid "mrWidget|branch does not exist."
msgid "mrWidget|branch does not exist."
...
...
spec/controllers/projects/branches_controller_spec.rb
View file @
c607b358
...
@@ -331,7 +331,7 @@ describe Projects::BranchesController do
...
@@ -331,7 +331,7 @@ describe Projects::BranchesController do
let
(
:branch
)
{
"feature"
}
let
(
:branch
)
{
"feature"
}
it
'returns JSON response with message'
do
it
'returns JSON response with message'
do
expect
(
json_response
).
to
eql
(
"message"
=>
'Branch was
remov
ed'
)
expect
(
json_response
).
to
eql
(
"message"
=>
'Branch was
delet
ed'
)
end
end
it
{
expect
(
response
).
to
have_gitlab_http_status
(
200
)
}
it
{
expect
(
response
).
to
have_gitlab_http_status
(
200
)
}
...
@@ -341,7 +341,7 @@ describe Projects::BranchesController do
...
@@ -341,7 +341,7 @@ describe Projects::BranchesController do
let
(
:branch
)
{
"improve/awesome"
}
let
(
:branch
)
{
"improve/awesome"
}
it
'returns JSON response with message'
do
it
'returns JSON response with message'
do
expect
(
json_response
).
to
eql
(
'message'
=>
'Branch was
remov
ed'
)
expect
(
json_response
).
to
eql
(
'message'
=>
'Branch was
delet
ed'
)
end
end
it
{
expect
(
response
).
to
have_gitlab_http_status
(
200
)
}
it
{
expect
(
response
).
to
have_gitlab_http_status
(
200
)
}
...
@@ -351,7 +351,7 @@ describe Projects::BranchesController do
...
@@ -351,7 +351,7 @@ describe Projects::BranchesController do
let
(
:branch
)
{
'improve%2Fawesome'
}
let
(
:branch
)
{
'improve%2Fawesome'
}
it
'returns JSON response with message'
do
it
'returns JSON response with message'
do
expect
(
json_response
).
to
eql
(
'message'
=>
'Branch was
remov
ed'
)
expect
(
json_response
).
to
eql
(
'message'
=>
'Branch was
delet
ed'
)
end
end
it
{
expect
(
response
).
to
have_gitlab_http_status
(
200
)
}
it
{
expect
(
response
).
to
have_gitlab_http_status
(
200
)
}
...
...
spec/features/merge_request/user_accepts_merge_request_spec.rb
View file @
c607b358
...
@@ -25,7 +25,7 @@ describe 'User accepts a merge request', :js do
...
@@ -25,7 +25,7 @@ describe 'User accepts a merge request', :js do
end
end
it
'accepts a merge request'
do
it
'accepts a merge request'
do
check
(
'
Remov
e source branch'
)
check
(
'
Delet
e source branch'
)
click_button
(
'Merge'
)
click_button
(
'Merge'
)
expect
(
page
).
to
have_content
(
'The changes were merged into'
)
expect
(
page
).
to
have_content
(
'The changes were merged into'
)
...
@@ -60,7 +60,7 @@ describe 'User accepts a merge request', :js do
...
@@ -60,7 +60,7 @@ describe 'User accepts a merge request', :js do
end
end
it
'accepts a merge request'
do
it
'accepts a merge request'
do
check
(
'
Remov
e source branch'
)
check
(
'
Delet
e source branch'
)
click_button
(
'Merge'
)
click_button
(
'Merge'
)
expect
(
page
).
to
have_content
(
'The changes were merged into'
)
expect
(
page
).
to
have_content
(
'The changes were merged into'
)
...
...
spec/features/merge_request/user_merges_when_pipeline_succeeds_spec.rb
View file @
c607b358
...
@@ -33,7 +33,7 @@ describe 'Merge request > User merges when pipeline succeeds', :js do
...
@@ -33,7 +33,7 @@ describe 'Merge request > User merges when pipeline succeeds', :js do
click_button
"Merge when pipeline succeeds"
click_button
"Merge when pipeline succeeds"
expect
(
page
).
to
have_content
"Set by
#{
user
.
name
}
to be merged automatically when the pipeline succeeds"
expect
(
page
).
to
have_content
"Set by
#{
user
.
name
}
to be merged automatically when the pipeline succeeds"
expect
(
page
).
to
have_content
"The source branch will not be
remov
ed"
expect
(
page
).
to
have_content
"The source branch will not be
delet
ed"
expect
(
page
).
to
have_selector
".js-cancel-auto-merge"
expect
(
page
).
to
have_selector
".js-cancel-auto-merge"
visit
project_merge_request_path
(
project
,
merge_request
)
# Needed to refresh the page
visit
project_merge_request_path
(
project
,
merge_request
)
# Needed to refresh the page
expect
(
page
).
to
have_content
/enabled an automatic merge when the pipeline for \h{8} succeeds/i
expect
(
page
).
to
have_content
/enabled an automatic merge when the pipeline for \h{8} succeeds/i
...
@@ -94,7 +94,7 @@ describe 'Merge request > User merges when pipeline succeeds', :js do
...
@@ -94,7 +94,7 @@ describe 'Merge request > User merges when pipeline succeeds', :js do
click_link
'Merge when pipeline succeeds'
click_link
'Merge when pipeline succeeds'
expect
(
page
).
to
have_content
"Set by
#{
user
.
name
}
to be merged automatically when the pipeline succeeds"
expect
(
page
).
to
have_content
"Set by
#{
user
.
name
}
to be merged automatically when the pipeline succeeds"
expect
(
page
).
to
have_content
"The source branch will not be
remov
ed"
expect
(
page
).
to
have_content
"The source branch will not be
delet
ed"
expect
(
page
).
to
have_link
"Cancel automatic merge"
expect
(
page
).
to
have_link
"Cancel automatic merge"
end
end
end
end
...
@@ -127,10 +127,10 @@ describe 'Merge request > User merges when pipeline succeeds', :js do
...
@@ -127,10 +127,10 @@ describe 'Merge request > User merges when pipeline succeeds', :js do
expect
(
page
).
to
have_content
"canceled the automatic merge"
expect
(
page
).
to
have_content
"canceled the automatic merge"
end
end
it
'allows to
remov
e source branch'
do
it
'allows to
delet
e source branch'
do
click_link
"
Remov
e source branch"
click_link
"
Delet
e source branch"
expect
(
page
).
to
have_content
"The source branch will be
remov
ed"
expect
(
page
).
to
have_content
"The source branch will be
delet
ed"
end
end
context
'when pipeline succeeds'
do
context
'when pipeline succeeds'
do
...
...
spec/features/merge_request/user_sees_merge_widget_spec.rb
View file @
c607b358
...
@@ -316,7 +316,7 @@ describe 'Merge request > User sees merge widget', :js do
...
@@ -316,7 +316,7 @@ describe 'Merge request > User sees merge widget', :js do
it
'user cannot remove source branch'
do
it
'user cannot remove source branch'
do
expect
(
page
).
not_to
have_field
(
'remove-source-branch-input'
)
expect
(
page
).
not_to
have_field
(
'remove-source-branch-input'
)
expect
(
page
).
to
have_content
(
'
Remov
es source branch'
)
expect
(
page
).
to
have_content
(
'
Delet
es source branch'
)
end
end
end
end
...
...
spec/features/merge_requests/user_squashes_merge_request_spec.rb
View file @
c607b358
...
@@ -38,7 +38,7 @@ describe 'User squashes a merge request', :js do
...
@@ -38,7 +38,7 @@ describe 'User squashes a merge request', :js do
def
accept_mr
def
accept_mr
expect
(
page
).
to
have_button
(
'Merge'
)
expect
(
page
).
to
have_button
(
'Merge'
)
uncheck
'
Remov
e source branch'
uncheck
'
Delet
e source branch'
click_on
'Merge'
click_on
'Merge'
end
end
...
...
spec/features/protected_branches_spec.rb
View file @
c607b358
...
@@ -97,7 +97,7 @@ describe 'Protected Branches', :js do
...
@@ -97,7 +97,7 @@ describe 'Protected Branches', :js do
set_protected_branch_name
(
'some-branch'
)
set_protected_branch_name
(
'some-branch'
)
click_on
"Protect"
click_on
"Protect"
within
(
".protected-branches-list"
)
{
expect
(
page
).
to
have_content
(
'branch was
remov
ed'
)
}
within
(
".protected-branches-list"
)
{
expect
(
page
).
to
have_content
(
'branch was
delet
ed'
)
}
end
end
end
end
...
...
spec/javascripts/vue_mr_widget/components/states/mr_widget_merge_when_pipeline_succeeds_spec.js
View file @
c607b358
...
@@ -121,14 +121,14 @@ describe('MRWidgetMergeWhenPipelineSucceeds', () => {
...
@@ -121,14 +121,14 @@ describe('MRWidgetMergeWhenPipelineSucceeds', () => {
expect
(
vm
.
$el
.
innerText
).
toContain
(
'
to be merged automatically when the pipeline succeeds
'
);
expect
(
vm
.
$el
.
innerText
).
toContain
(
'
to be merged automatically when the pipeline succeeds
'
);
expect
(
vm
.
$el
.
innerText
).
toContain
(
'
The changes will be merged into
'
);
expect
(
vm
.
$el
.
innerText
).
toContain
(
'
The changes will be merged into
'
);
expect
(
vm
.
$el
.
innerText
).
toContain
(
targetBranch
);
expect
(
vm
.
$el
.
innerText
).
toContain
(
targetBranch
);
expect
(
vm
.
$el
.
innerText
).
toContain
(
'
The source branch will not be
remov
ed
'
);
expect
(
vm
.
$el
.
innerText
).
toContain
(
'
The source branch will not be
delet
ed
'
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-cancel-auto-merge
'
).
innerText
).
toContain
(
expect
(
vm
.
$el
.
querySelector
(
'
.js-cancel-auto-merge
'
).
innerText
).
toContain
(
'
Cancel automatic merge
'
,
'
Cancel automatic merge
'
,
);
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-cancel-auto-merge
'
).
getAttribute
(
'
disabled
'
)).
toBeFalsy
();
expect
(
vm
.
$el
.
querySelector
(
'
.js-cancel-auto-merge
'
).
getAttribute
(
'
disabled
'
)).
toBeFalsy
();
expect
(
vm
.
$el
.
querySelector
(
'
.js-remove-source-branch
'
).
innerText
).
toContain
(
expect
(
vm
.
$el
.
querySelector
(
'
.js-remove-source-branch
'
).
innerText
).
toContain
(
'
Remov
e source branch
'
,
'
Delet
e source branch
'
,
);
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-remove-source-branch
'
).
getAttribute
(
'
disabled
'
)).
toBeFalsy
();
expect
(
vm
.
$el
.
querySelector
(
'
.js-remove-source-branch
'
).
getAttribute
(
'
disabled
'
)).
toBeFalsy
();
...
@@ -143,19 +143,19 @@ describe('MRWidgetMergeWhenPipelineSucceeds', () => {
...
@@ -143,19 +143,19 @@ describe('MRWidgetMergeWhenPipelineSucceeds', () => {
});
});
});
});
it
(
'
should show source branch will be
remov
ed text when it source branch set to remove
'
,
done
=>
{
it
(
'
should show source branch will be
delet
ed text when it source branch set to remove
'
,
done
=>
{
vm
.
mr
.
shouldRemoveSourceBranch
=
true
;
vm
.
mr
.
shouldRemoveSourceBranch
=
true
;
Vue
.
nextTick
(()
=>
{
Vue
.
nextTick
(()
=>
{
const
normalizedText
=
vm
.
$el
.
innerText
.
replace
(
/
\s
+/g
,
'
'
);
const
normalizedText
=
vm
.
$el
.
innerText
.
replace
(
/
\s
+/g
,
'
'
);
expect
(
normalizedText
).
toContain
(
'
The source branch will be
remov
ed
'
);
expect
(
normalizedText
).
toContain
(
'
The source branch will be
delet
ed
'
);
expect
(
normalizedText
).
not
.
toContain
(
'
The source branch will not be
remov
ed
'
);
expect
(
normalizedText
).
not
.
toContain
(
'
The source branch will not be
delet
ed
'
);
done
();
done
();
});
});
});
});
it
(
'
should not show
remove source branch button when user not able to remov
e source branch
'
,
done
=>
{
it
(
'
should not show
delete source branch button when user not able to delet
e source branch
'
,
done
=>
{
vm
.
mr
.
currentUserId
=
4
;
vm
.
mr
.
currentUserId
=
4
;
Vue
.
nextTick
(()
=>
{
Vue
.
nextTick
(()
=>
{
...
@@ -164,7 +164,7 @@ describe('MRWidgetMergeWhenPipelineSucceeds', () => {
...
@@ -164,7 +164,7 @@ describe('MRWidgetMergeWhenPipelineSucceeds', () => {
});
});
});
});
it
(
'
should disable
remov
e source branch button when the action is in progress
'
,
done
=>
{
it
(
'
should disable
delet
e source branch button when the action is in progress
'
,
done
=>
{
vm
.
isRemovingSourceBranch
=
true
;
vm
.
isRemovingSourceBranch
=
true
;
Vue
.
nextTick
(()
=>
{
Vue
.
nextTick
(()
=>
{
...
...
spec/javascripts/vue_mr_widget/components/states/mr_widget_merged_spec.js
View file @
c607b358
...
@@ -128,7 +128,7 @@ describe('MRWidgetMerged', () => {
...
@@ -128,7 +128,7 @@ describe('MRWidgetMerged', () => {
new
Promise
(
resolve
=>
{
new
Promise
(
resolve
=>
{
resolve
({
resolve
({
data
:
{
data
:
{
message
:
'
Branch was
remov
ed
'
,
message
:
'
Branch was
delet
ed
'
,
},
},
});
});
}),
}),
...
@@ -157,8 +157,8 @@ describe('MRWidgetMerged', () => {
...
@@ -157,8 +157,8 @@ describe('MRWidgetMerged', () => {
expect
(
vm
.
$el
.
textContent
).
toContain
(
targetBranch
);
expect
(
vm
.
$el
.
textContent
).
toContain
(
targetBranch
);
});
});
it
(
'
renders information about branch being
remov
ed
'
,
()
=>
{
it
(
'
renders information about branch being
delet
ed
'
,
()
=>
{
expect
(
vm
.
$el
.
textContent
).
toContain
(
'
The source branch has been
remov
ed
'
);
expect
(
vm
.
$el
.
textContent
).
toContain
(
'
The source branch has been
delet
ed
'
);
});
});
it
(
'
shows revert and cherry-pick buttons
'
,
()
=>
{
it
(
'
shows revert and cherry-pick buttons
'
,
()
=>
{
...
@@ -189,24 +189,24 @@ describe('MRWidgetMerged', () => {
...
@@ -189,24 +189,24 @@ describe('MRWidgetMerged', () => {
expect
(
selectors
.
mergeCommitShaLink
.
href
).
toBe
(
vm
.
mr
.
mergeCommitPath
);
expect
(
selectors
.
mergeCommitShaLink
.
href
).
toBe
(
vm
.
mr
.
mergeCommitPath
);
});
});
it
(
'
should not show source branch
remov
ed text
'
,
done
=>
{
it
(
'
should not show source branch
delet
ed text
'
,
done
=>
{
vm
.
mr
.
sourceBranchRemoved
=
false
;
vm
.
mr
.
sourceBranchRemoved
=
false
;
Vue
.
nextTick
(()
=>
{
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
$el
.
innerText
).
toContain
(
'
You can
remov
e source branch now
'
);
expect
(
vm
.
$el
.
innerText
).
toContain
(
'
You can
delete th
e source branch now
'
);
expect
(
vm
.
$el
.
innerText
).
not
.
toContain
(
'
The source branch has been
remov
ed
'
);
expect
(
vm
.
$el
.
innerText
).
not
.
toContain
(
'
The source branch has been
delet
ed
'
);
done
();
done
();
});
});
});
});
it
(
'
should show source branch
remov
ing text
'
,
done
=>
{
it
(
'
should show source branch
delet
ing text
'
,
done
=>
{
vm
.
mr
.
isRemovingSourceBranch
=
true
;
vm
.
mr
.
isRemovingSourceBranch
=
true
;
vm
.
mr
.
sourceBranchRemoved
=
false
;
vm
.
mr
.
sourceBranchRemoved
=
false
;
Vue
.
nextTick
(()
=>
{
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
$el
.
innerText
).
toContain
(
'
The source branch is being
remov
ed
'
);
expect
(
vm
.
$el
.
innerText
).
toContain
(
'
The source branch is being
delet
ed
'
);
expect
(
vm
.
$el
.
innerText
).
not
.
toContain
(
'
You can
remov
e source branch now
'
);
expect
(
vm
.
$el
.
innerText
).
not
.
toContain
(
'
You can
delete th
e source branch now
'
);
expect
(
vm
.
$el
.
innerText
).
not
.
toContain
(
'
The source branch has been
remov
ed
'
);
expect
(
vm
.
$el
.
innerText
).
not
.
toContain
(
'
The source branch has been
delet
ed
'
);
done
();
done
();
});
});
});
});
...
...
spec/javascripts/vue_mr_widget/mr_widget_options_spec.js
View file @
c607b358
...
@@ -453,7 +453,7 @@ describe('mrWidgetOptions', () => {
...
@@ -453,7 +453,7 @@ describe('mrWidgetOptions', () => {
vm
.
$nextTick
(()
=>
{
vm
.
$nextTick
(()
=>
{
const
tooltip
=
vm
.
$el
.
querySelector
(
'
.fa-question-circle
'
);
const
tooltip
=
vm
.
$el
.
querySelector
(
'
.fa-question-circle
'
);
expect
(
vm
.
$el
.
textContent
).
toContain
(
'
Remov
es source branch
'
);
expect
(
vm
.
$el
.
textContent
).
toContain
(
'
Delet
es source branch
'
);
expect
(
tooltip
.
getAttribute
(
'
data-original-title
'
)).
toBe
(
expect
(
tooltip
.
getAttribute
(
'
data-original-title
'
)).
toBe
(
'
A user with write access to the source branch selected this option
'
,
'
A user with write access to the source branch selected this option
'
,
);
);
...
@@ -468,8 +468,8 @@ describe('mrWidgetOptions', () => {
...
@@ -468,8 +468,8 @@ describe('mrWidgetOptions', () => {
vm
.
mr
.
state
=
'
merged
'
;
vm
.
mr
.
state
=
'
merged
'
;
vm
.
$nextTick
(()
=>
{
vm
.
$nextTick
(()
=>
{
expect
(
vm
.
$el
.
textContent
).
toContain
(
'
The source branch has been
remov
ed
'
);
expect
(
vm
.
$el
.
textContent
).
toContain
(
'
The source branch has been
delet
ed
'
);
expect
(
vm
.
$el
.
textContent
).
not
.
toContain
(
'
Remov
es source branch
'
);
expect
(
vm
.
$el
.
textContent
).
not
.
toContain
(
'
Delet
es source branch
'
);
done
();
done
();
});
});
...
...
spec/support/shared_examples/features/editable_merge_request_shared_examples.rb
View file @
c607b358
...
@@ -129,12 +129,12 @@ RSpec.shared_examples 'an editable merge request' do
...
@@ -129,12 +129,12 @@ RSpec.shared_examples 'an editable merge request' do
expect
(
merge_request
.
merge_params
[
'force_remove_source_branch'
]).
to
be_truthy
expect
(
merge_request
.
merge_params
[
'force_remove_source_branch'
]).
to
be_truthy
visit
edit_project_merge_request_path
(
target_project
,
merge_request
)
visit
edit_project_merge_request_path
(
target_project
,
merge_request
)
uncheck
'
Remov
e source branch when merge request is accepted'
uncheck
'
Delet
e source branch when merge request is accepted'
click_button
'Save changes'
click_button
'Save changes'
expect
(
page
).
to
have_unchecked_field
'remove-source-branch-input'
expect
(
page
).
to
have_unchecked_field
'remove-source-branch-input'
expect
(
page
).
to
have_content
'
Remov
e source branch'
expect
(
page
).
to
have_content
'
Delet
e source branch'
end
end
end
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