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
04c1f740
Commit
04c1f740
authored
Aug 03, 2020
by
Giorgenes Gelatti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor package graphql specs
remove uneeded license specific context
parent
d9983961
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
26 deletions
+24
-26
spec/requests/api/graphql/project/packages_spec.rb
spec/requests/api/graphql/project/packages_spec.rb
+24
-26
No files found.
spec/requests/api/graphql/project/packages_spec.rb
View file @
04c1f740
...
@@ -28,42 +28,40 @@ RSpec.describe 'getting a package list for a project' do
...
@@ -28,42 +28,40 @@ RSpec.describe 'getting a package list for a project' do
)
)
end
end
context
'without the need for a license'
do
context
'when user has access to the project'
do
context
'when user has access to the project'
do
before
do
before
do
project
.
add_reporter
(
current_user
)
project
.
add_reporter
(
current_user
)
post_graphql
(
query
,
current_user:
current_user
)
post_graphql
(
query
,
current_user:
current_user
)
end
end
it_behaves_like
'a working graphql query'
it_behaves_like
'a working graphql query'
it
'returns packages successfully'
do
it
'returns packages successfully'
do
expect
(
packages_data
[
0
][
'node'
][
'name'
]).
to
eq
package
.
name
expect
(
packages_data
[
0
][
'node'
][
'name'
]).
to
eq
package
.
name
end
end
end
end
context
'when the user does not have access to the project/packages'
do
context
'when the user does not have access to the project/packages'
do
before
do
before
do
post_graphql
(
query
,
current_user:
current_user
)
post_graphql
(
query
,
current_user:
current_user
)
end
end
it_behaves_like
'a working graphql query'
it_behaves_like
'a working graphql query'
it
'returns nil'
do
it
'returns nil'
do
expect
(
graphql_data
[
'project'
]).
to
be_nil
expect
(
graphql_data
[
'project'
]).
to
be_nil
end
end
end
end
context
'when the user is not autenthicated'
do
context
'when the user is not autenthicated'
do
before
do
before
do
post_graphql
(
query
)
post_graphql
(
query
)
end
end
it_behaves_like
'a working graphql query'
it_behaves_like
'a working graphql query'
it
'returns nil'
do
it
'returns nil'
do
expect
(
graphql_data
[
'project'
]).
to
be_nil
expect
(
graphql_data
[
'project'
]).
to
be_nil
end
end
end
end
end
end
end
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