diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-24 00:09:13 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-24 00:09:13 +0300 |
commit | 145fb28542af4441ee8dc5752f9879ec1c1de15d (patch) | |
tree | 9cb574f4a75eb6d0486b2ef076310c9092373d21 /spec/contracts/provider | |
parent | 35272ed523e03fd0f2a77e6951eb4017cdb224ff (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_list_project_pipelines_helper.rb | 16 | ||||
-rw-r--r-- | spec/contracts/provider/states/project/pipeline/pipelines_state.rb | 26 |
2 files changed, 42 insertions, 0 deletions
diff --git a/spec/contracts/provider/pact_helpers/project/pipeline/get_list_project_pipelines_helper.rb b/spec/contracts/provider/pact_helpers/project/pipeline/get_list_project_pipelines_helper.rb new file mode 100644 index 00000000000..5307468b7c6 --- /dev/null +++ b/spec/contracts/provider/pact_helpers/project/pipeline/get_list_project_pipelines_helper.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +require_relative '../../../spec_helper' +require_relative '../../../states/project/pipeline/pipelines_state' + +module Provider + module GetListProjectPipelinesHelper + Pact.service_provider "GET List project pipelines" do + app { Environments::Test.app } + + honours_pact_with 'Pipelines#index' do + pact_uri '../contracts/project/project/pipeline/index/pipelines#index-get_list_project_pipelines.json' + end + end + end +end diff --git a/spec/contracts/provider/states/project/pipeline/pipelines_state.rb b/spec/contracts/provider/states/project/pipeline/pipelines_state.rb new file mode 100644 index 00000000000..639c25e9894 --- /dev/null +++ b/spec/contracts/provider/states/project/pipeline/pipelines_state.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +Pact.provider_states_for "Pipelines#index" do + provider_state "a few pipelines 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, + project: project, + user: user, + duration: 10, + finished_at: '2022-06-01T02:47:31.432Z', + builds: [scheduled_job, manual_job] + ) + end + end +end |