diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-31 09:16:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-31 09:16:45 +0300 |
commit | e4805b324cb9e620788bb2d625f633f2be20091d (patch) | |
tree | fcd95b7b35572e6a06e71178d791350467875c38 /spec/frontend/fixtures/pipelines.rb | |
parent | 95cb5e20a13cbea5e57c25df47aba1e2c9035466 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/fixtures/pipelines.rb')
-rw-r--r-- | spec/frontend/fixtures/pipelines.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/frontend/fixtures/pipelines.rb b/spec/frontend/fixtures/pipelines.rb index 768934d6278..24a6f6f7de6 100644 --- a/spec/frontend/fixtures/pipelines.rb +++ b/spec/frontend/fixtures/pipelines.rb @@ -3,6 +3,8 @@ require 'spec_helper' RSpec.describe Projects::PipelinesController, '(JavaScript fixtures)', type: :controller do + include ApiHelpers + include GraphqlHelpers include JavaScriptFixturesHelpers let_it_be(:namespace) { create(:namespace, name: 'frontend-fixtures') } @@ -56,4 +58,27 @@ RSpec.describe Projects::PipelinesController, '(JavaScript fixtures)', type: :co expect(response).to be_successful end + + describe GraphQL::Query, type: :request do + fixtures_path = 'graphql/pipelines/' + get_pipeline_actions_query = 'get_pipeline_actions.query.graphql' + + let!(:pipeline_with_manual_actions) { create(:ci_pipeline, project: project, user: user) } + let!(:build_scheduled) { create(:ci_build, :scheduled, pipeline: pipeline_with_manual_actions, stage: 'test') } + let!(:build_manual) { create(:ci_build, :manual, pipeline: pipeline_with_manual_actions, stage: 'build') } + let!(:build_manual_cannot_play) do + create(:ci_build, :manual, :skipped, pipeline: pipeline_with_manual_actions, stage: 'build') + end + + let_it_be(:query) do + get_graphql_query_as_string("pipelines/graphql/queries/#{get_pipeline_actions_query}") + end + + it "#{fixtures_path}#{get_pipeline_actions_query}.json" do + post_graphql(query, current_user: user, + variables: { fullPath: project.full_path, iid: pipeline_with_manual_actions.iid }) + + expect_graphql_errors_to_be_empty + end + end end |