Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
21bb66e3
Commit
21bb66e3
authored
Mar 01, 2021
by
Alex Kalderimis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply reviewer feedback
parent
da9b86a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
4 deletions
+2
-4
spec/graphql/types/snippets/blob_type_spec.rb
spec/graphql/types/snippets/blob_type_spec.rb
+1
-2
spec/requests/api/graphql/snippets_spec.rb
spec/requests/api/graphql/snippets_spec.rb
+1
-2
No files found.
spec/graphql/types/snippets/blob_type_spec.rb
View file @
21bb66e3
...
@@ -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
))
...
...
spec/requests/api/graphql/snippets_spec.rb
View file @
21bb66e3
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment