diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-15 03:08:49 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-15 03:08:49 +0300 |
commit | 9de5cc2d1f25957d51268cd5b4c9c77a4ba4f695 (patch) | |
tree | 2b731956adb9c79408601c8f0d6157a84cbacc22 /spec/contracts/provider | |
parent | cde60c9291a22ff0921f703568c4daef4a65ead7 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/contracts/provider')
-rw-r--r-- | spec/contracts/provider/pact_helpers/project/pipeline/get_pipeline_header_data_helper.rb | 16 | ||||
-rw-r--r-- | spec/contracts/provider/states/project/pipeline/pipeline_state.rb | 27 |
2 files changed, 43 insertions, 0 deletions
diff --git a/spec/contracts/provider/pact_helpers/project/pipeline/get_pipeline_header_data_helper.rb b/spec/contracts/provider/pact_helpers/project/pipeline/get_pipeline_header_data_helper.rb new file mode 100644 index 00000000000..abb2781f987 --- /dev/null +++ b/spec/contracts/provider/pact_helpers/project/pipeline/get_pipeline_header_data_helper.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +require_relative '../../../spec_helper' +require_relative '../../../states/project/pipeline/pipeline_state' + +module Provider + module GetPipelinesHeaderDataHelper + Pact.service_provider "GET pipeline header data" do + app { Environments::Test.app } + + honours_pact_with 'Pipelines#show' do + pact_uri '../contracts/project/pipeline/show/pipelines#show-get_project_pipeline_header_data.json' + end + end + end +end diff --git a/spec/contracts/provider/states/project/pipeline/pipeline_state.rb b/spec/contracts/provider/states/project/pipeline/pipeline_state.rb new file mode 100644 index 00000000000..d1a4cd34bdd --- /dev/null +++ b/spec/contracts/provider/states/project/pipeline/pipeline_state.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +Pact.provider_states_for "Pipelines#show" do + provider_state "a pipeline for a project exists" do + set_up do + user = User.find_by(name: Provider::UsersHelper::CONTRACT_USER_NAME) + namespace = create(:namespace, name: 'gitlab-org') + project = create(:project, :repository, name: 'gitlab-qa', namespace: namespace, creator: user) + scheduled_job = create(:ci_build, :scheduled) + manual_job = create(:ci_build, :manual) + + project.add_maintainer(user) + + create( + :ci_pipeline, + :with_job, + :success, + iid: 1, + project: project, + user: user, + duration: 10, + finished_at: '2022-06-01T02:47:31.432Z', + builds: [scheduled_job, manual_job] + ) + end + end +end |