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
e2d2bbcc
Commit
e2d2bbcc
authored
Jul 07, 2021
by
Allison Browne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix delete pipeline feature spec
parent
060d64bf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
17 deletions
+31
-17
app/services/ci/destroy_pipeline_service.rb
app/services/ci/destroy_pipeline_service.rb
+1
-1
spec/features/projects/pipelines/pipeline_spec.rb
spec/features/projects/pipelines/pipeline_spec.rb
+30
-16
No files found.
app/services/ci/destroy_pipeline_service.rb
View file @
e2d2bbcc
...
@@ -9,7 +9,7 @@ module Ci
...
@@ -9,7 +9,7 @@ module Ci
pipeline
.
cancel_running
if
pipeline
.
cancelable?
&&
::
Feature
.
enabled?
(
:cancel_pipelines_prior_to_destroy
,
default_enabled: :yaml
)
pipeline
.
cancel_running
if
pipeline
.
cancelable?
&&
::
Feature
.
enabled?
(
:cancel_pipelines_prior_to_destroy
,
default_enabled: :yaml
)
pipeline
.
destroy!
pipeline
.
reset
.
destroy!
ServiceResponse
.
success
(
message:
'Pipeline not found'
)
ServiceResponse
.
success
(
message:
'Pipeline not found'
)
rescue
ActiveRecord
::
RecordNotFound
rescue
ActiveRecord
::
RecordNotFound
...
...
spec/features/projects/pipelines/pipeline_spec.rb
View file @
e2d2bbcc
...
@@ -434,6 +434,7 @@ RSpec.describe 'Pipeline', :js do
...
@@ -434,6 +434,7 @@ RSpec.describe 'Pipeline', :js do
end
end
end
end
shared_context
'delete pipeline'
do
context
'deleting pipeline'
do
context
'deleting pipeline'
do
context
'when user can not delete'
do
context
'when user can not delete'
do
before
do
before
do
...
@@ -453,12 +454,25 @@ RSpec.describe 'Pipeline', :js do
...
@@ -453,12 +454,25 @@ RSpec.describe 'Pipeline', :js do
click_button
'Delete pipeline'
click_button
'Delete pipeline'
end
end
it
'redirects to pipeline overview page'
,
:sidekiq_might_not_need
_inline
do
it
'redirects to pipeline overview page'
,
:sidekiq
_inline
do
expect
(
page
).
to
have_content
(
'The pipeline has been deleted'
)
expect
(
page
).
to
have_content
(
'The pipeline has been deleted'
)
expect
(
current_path
).
to
eq
(
project_pipelines_path
(
project
))
expect
(
current_path
).
to
eq
(
project_pipelines_path
(
project
))
end
end
end
end
end
end
end
context
'when cancel_pipelines_prior_to_destroy is enabled'
do
include_context
'delete pipeline'
end
context
'when cancel_pipelines_prior_to_destroy is disabled'
do
before
do
stub_feature_flags
(
cancel_pipelines_prior_to_destroy:
false
)
end
include_context
'delete pipeline'
end
context
'when pipeline ref does not exist in repository anymore'
do
context
'when pipeline ref does not exist in repository anymore'
do
let
(
:pipeline
)
do
let
(
:pipeline
)
do
...
...
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