Welcome to mirror list, hosted at ThFree Co, Russian Federation.

job_artifacts.rb « fixtures « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e53cdbbaaa521f6c3ab26b8144f9d369dbc7c1ed (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
# 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