summaryrefslogtreecommitdiff
path: root/spec/frontend/fixtures/namespaces.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/fixtures/namespaces.rb')
-rw-r--r--spec/frontend/fixtures/namespaces.rb47
1 files changed, 26 insertions, 21 deletions
diff --git a/spec/frontend/fixtures/namespaces.rb b/spec/frontend/fixtures/namespaces.rb
index b11f661fe09..a3f295f4e66 100644
--- a/spec/frontend/fixtures/namespaces.rb
+++ b/spec/frontend/fixtures/namespaces.rb
@@ -7,38 +7,43 @@ RSpec.describe 'Jobs (JavaScript fixtures)' do
include JavaScriptFixturesHelpers
include GraphqlHelpers
- describe GraphQL::Query, type: :request do
+ describe API::Projects, type: :request do
let_it_be(:user) { create(:user) }
- let_it_be(:groups) { create_list(:group, 4) }
- before_all do
- groups.each { |group| group.add_owner(user) }
- end
+ describe 'transfer_locations' do
+ let_it_be(:groups) { create_list(:group, 4) }
+ let_it_be(:project) { create(:project, namespace: user.namespace) }
- query_name = 'search_namespaces_where_user_can_transfer_projects'
- query_extension = '.query.graphql'
+ before_all do
+ groups.each { |group| group.add_owner(user) }
+ end
- full_input_path = "projects/settings/graphql/queries/#{query_name}#{query_extension}"
- base_output_path = "graphql/projects/settings/#{query_name}"
+ it 'api/projects/transfer_locations_page_1.json' do
+ get api("/projects/#{project.id}/transfer_locations?per_page=2", user)
- it "#{base_output_path}_page_1#{query_extension}.json" do
- query = get_graphql_query_as_string(full_input_path)
+ expect(response).to be_successful
+ end
- post_graphql(query, current_user: user, variables: { first: 2 })
+ it 'api/projects/transfer_locations_page_2.json' do
+ get api("/projects/#{project.id}/transfer_locations?per_page=2&page=2", user)
- expect_graphql_errors_to_be_empty
+ 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'
- it "#{base_output_path}_page_2#{query_extension}.json" do
- query = get_graphql_query_as_string(full_input_path)
+ input_path = "projects/settings/graphql/queries/#{query_name}"
+ output_path = "graphql/projects/settings/#{query_name}.json"
- post_graphql(query, current_user: user, variables: { first: 2 })
+ it output_path do
+ query = get_graphql_query_as_string(input_path)
- post_graphql(
- query,
- current_user: user,
- variables: { first: 2, after: graphql_data_at('currentUser', 'groups', 'pageInfo', 'endCursor') }
- )
+ post_graphql(query, current_user: user)
expect_graphql_errors_to_be_empty
end