diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 18:10:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 18:10:58 +0300 |
commit | 049d16d168fdee408b78f5f38619c092fd3b2265 (patch) | |
tree | 22d1db5ab4fae0967a4da4b1a6b097ef9e5d7aa2 /spec/frontend/fixtures/job_artifacts.rb | |
parent | bf18f3295b550c564086efd0a32d9a25435ce216 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/fixtures/job_artifacts.rb')
-rw-r--r-- | spec/frontend/fixtures/job_artifacts.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/frontend/fixtures/job_artifacts.rb b/spec/frontend/fixtures/job_artifacts.rb new file mode 100644 index 00000000000..e53cdbbaaa5 --- /dev/null +++ b/spec/frontend/fixtures/job_artifacts.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'Job Artifacts (GraphQL fixtures)' do + describe GraphQL::Query, type: :request do + include ApiHelpers + include GraphqlHelpers + include JavaScriptFixturesHelpers + + let_it_be(:project) { create(:project, :repository, :public) } + let_it_be(:pipeline) { create(:ci_pipeline, project: project) } + let_it_be(:user) { create(:user) } + + job_artifacts_query_path = 'artifacts/graphql/queries/get_job_artifacts.query.graphql' + + it "graphql/#{job_artifacts_query_path}.json" do + create(:ci_build, :failed, :artifacts, :trace_artifact, pipeline: pipeline) + create(:ci_build, :success, :artifacts, :trace_artifact, pipeline: pipeline) + + query = get_graphql_query_as_string(job_artifacts_query_path) + + post_graphql(query, current_user: user, variables: { projectPath: project.full_path }) + + expect_graphql_errors_to_be_empty + end + end +end |