summaryrefslogtreecommitdiff
path: root/spec/features/projects/pipelines
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-08 12:07:59 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-08 12:07:59 +0000
commite3e300557f5def9bf2271735c8a620e6820dfada (patch)
tree8d0d4590518ee17eb32956e35637e11a2b8ca561 /spec/features/projects/pipelines
parenta821bd6ad17e304ca93838a411410a44ee9cff9f (diff)
downloadgitlab-ce-e3e300557f5def9bf2271735c8a620e6820dfada.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/projects/pipelines')
-rw-r--r--spec/features/projects/pipelines/pipeline_spec.rb29
1 files changed, 28 insertions, 1 deletions
diff --git a/spec/features/projects/pipelines/pipeline_spec.rb b/spec/features/projects/pipelines/pipeline_spec.rb
index 4b97c58d920..198af65c361 100644
--- a/spec/features/projects/pipelines/pipeline_spec.rb
+++ b/spec/features/projects/pipelines/pipeline_spec.rb
@@ -59,7 +59,8 @@ describe 'Pipeline', :js do
describe 'GET /:project/pipelines/:id' do
include_context 'pipeline builds'
- let(:project) { create(:project, :repository) }
+ let(:group) { create(:group) }
+ let(:project) { create(:project, :repository, group: group) }
let(:pipeline) { create(:ci_pipeline, project: project, ref: 'master', sha: project.commit.id, user: user) }
subject(:visit_pipeline) { visit project_pipeline_path(project, pipeline) }
@@ -329,6 +330,32 @@ describe 'Pipeline', :js do
end
end
+ context 'deleting pipeline' do
+ context 'when user can not delete' do
+ before do
+ visit_pipeline
+ end
+
+ it { expect(page).not_to have_button('Delete') }
+ end
+
+ context 'when deleting' do
+ before do
+ group.add_owner(user)
+
+ visit_pipeline
+
+ click_button 'Delete'
+ click_button 'Delete pipeline'
+ end
+
+ it 'redirects to pipeline overview page', :sidekiq_might_not_need_inline do
+ expect(page).to have_content('The pipeline has been deleted')
+ expect(current_path).to eq(project_pipelines_path(project))
+ end
+ end
+ end
+
context 'when pipeline ref does not exist in repository anymore' do
let(:pipeline) do
create(:ci_empty_pipeline, project: project,