Commit 21bb66e3 authored by Alex Kalderimis's avatar Alex Kalderimis

Apply reviewer feedback

parent da9b86a3
...@@ -27,11 +27,10 @@ RSpec.describe GitlabSchema.types['SnippetBlob'] do ...@@ -27,11 +27,10 @@ RSpec.describe GitlabSchema.types['SnippetBlob'] do
specify { expect(described_class.fields['externalStorage'].type).not_to be_non_null } specify { expect(described_class.fields['externalStorage'].type).not_to be_non_null }
specify { expect(described_class.fields['renderedAsText'].type).to be_non_null } specify { expect(described_class.fields['renderedAsText'].type).to be_non_null }
let_it_be(:snippet) { create(:snippet, :public, :repository) } let_it_be(:blob) { create(:snippet, :public, :repository).blobs.first }
described_class.fields.each_value do |field| described_class.fields.each_value do |field|
it "resolves #{field.graphql_name} using the presenter", :request_store do it "resolves #{field.graphql_name} using the presenter", :request_store do
blob = Snippet.find(snippet.id).blobs.first
presented = SnippetBlobPresenter.new(blob) presented = SnippetBlobPresenter.new(blob)
expect(resolve_field(field, blob)).to eq(presented.try(field.method_sym)) expect(resolve_field(field, blob)).to eq(presented.try(field.method_sym))
......
...@@ -6,7 +6,6 @@ RSpec.describe 'snippets' do ...@@ -6,7 +6,6 @@ RSpec.describe 'snippets' do
include GraphqlHelpers include GraphqlHelpers
let_it_be(:current_user) { create(:user) } let_it_be(:current_user) { create(:user) }
let_it_be(:snippets) { create_list(:personal_snippet, 3, :repository, author: current_user) } let_it_be(:snippets) { create_list(:personal_snippet, 3, :repository, author: current_user) }
describe 'querying for all fields' do describe 'querying for all fields' do
...@@ -26,7 +25,7 @@ RSpec.describe 'snippets' do ...@@ -26,7 +25,7 @@ RSpec.describe 'snippets' do
describe 'snippet_blob_content' do describe 'snippet_blob_content' do
let_it_be(:query_file) do let_it_be(:query_file) do
Pathname.new(Rails.root.join('app/graphql/queries/snippet/snippet_blob_content.query.graphql')) Rails.root.join('app/graphql/queries/snippet/snippet_blob_content.query.graphql')
end end
it 'can query for rich snippet blob content' do it 'can query for rich snippet blob content' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment