diff options
-rw-r--r-- | spec/requests/api/graphql/gitlab_schema_spec.rb | 2 | ||||
-rw-r--r-- | spec/support/helpers/graphql_helpers.rb | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/spec/requests/api/graphql/gitlab_schema_spec.rb b/spec/requests/api/graphql/gitlab_schema_spec.rb index f95f460fd14..b63b4fb34df 100644 --- a/spec/requests/api/graphql/gitlab_schema_spec.rb +++ b/spec/requests/api/graphql/gitlab_schema_spec.rb @@ -5,7 +5,7 @@ describe 'GitlabSchema configurations' do it 'shows an error if complexity is too high' do project = create(:project, :repository) - query = graphql_query_for('project', { 'fullPath' => project.full_path }, "id\nname\ndescription") + query = graphql_query_for('project', { 'fullPath' => project.full_path }, %w(id name description)) allow(GitlabSchema).to receive(:max_query_complexity).and_return 1 diff --git a/spec/support/helpers/graphql_helpers.rb b/spec/support/helpers/graphql_helpers.rb index f59f42ee902..2f4e6e4c934 100644 --- a/spec/support/helpers/graphql_helpers.rb +++ b/spec/support/helpers/graphql_helpers.rb @@ -83,7 +83,8 @@ module GraphqlHelpers end def wrap_fields(fields) - return unless fields.strip.present? + fields = Array.wrap(fields).join("\n") + return unless fields.present? <<~FIELDS { |