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

namespaces.rb « fixtures « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a3f295f4e66510acd32570146ba7729614507b42 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe 'Jobs (JavaScript fixtures)' do
  include ApiHelpers
  include JavaScriptFixturesHelpers
  include GraphqlHelpers

  describe API::Projects, type: :request do
    let_it_be(:user) { create(:user) }

    describe 'transfer_locations' do
      let_it_be(:groups) { create_list(:group, 4) }
      let_it_be(:project) { create(:project, namespace: user.namespace) }

      before_all do
        groups.each { |group| group.add_owner(user) }
      end

      it 'api/projects/transfer_locations_page_1.json' do
        get api("/projects/#{project.id}/transfer_locations?per_page=2", user)

        expect(response).to be_successful
      end

      it 'api/projects/transfer_locations_page_2.json' do
        get api("/projects/#{project.id}/transfer_locations?per_page=2&page=2", user)

        expect(response).to be_successful
      end
    end
  end

  describe GraphQL::Query, type: :request do
    let_it_be(:user) { create(:user) }

    query_name = 'current_user_namespace.query.graphql'

    input_path = "projects/settings/graphql/queries/#{query_name}"
    output_path = "graphql/projects/settings/#{query_name}.json"

    it output_path do
      query = get_graphql_query_as_string(input_path)

      post_graphql(query, current_user: user)

      expect_graphql_errors_to_be_empty
    end
  end
end