blob: 567815858f315b3716c28b4142f2134f3b33cf00 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
# frozen_string_literal: true
module QA
RSpec.describe 'Verify' do
include Support::Api
let(:api_client) { Runtime::API::Client.new(:gitlab) }
describe 'Pipeline', :runner do
let(:project) do
Resource::Project.fabricate_via_api! do |project|
project.name = 'project-with-pipeline'
end
end
let!(:runner) do
Resource::Runner.fabricate! do |runner|
runner.project = project
runner.name = project.name
runner.tags = [project.name]
end
end
let!(:ci_file) do
Resource::Repository::Commit.fabricate_via_api! do |commit|
commit.project = project
commit.commit_message = 'Add .gitlab-ci.yml'
commit.add_files(
[
{
file_path: '.gitlab-ci.yml',
content: <<~YAML
job1:
tags:
- #{project.name}
script: echo 'OK'
YAML
}
]
)
end
end
let!(:pipeline_id) do
pipeline_create_request = Runtime::API::Request.new(api_client, "/projects/#{project.id}/pipeline?ref=master")
JSON.parse(post(pipeline_create_request.url, nil))['id']
end
let(:pipeline_data_request) { Runtime::API::Request.new(api_client, "/projects/#{project.id}/pipelines/#{pipeline_id}") }
before do
Support::Waiter.wait_until(max_duration: 30, sleep_interval: 3) do
JSON.parse(get(pipeline_data_request.url))['status'] != 'pending'
end
end
after do
runner.remove_via_api!
end
context 'when deleted via API' do
it 'is not found' do
delete(pipeline_data_request.url)
expect(JSON.parse(get(pipeline_data_request.url))['message'].downcase).to have_content('404 not found')
end
end
end
end
end
|