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
517dd200
Commit
517dd200
authored
Mar 01, 2021
by
Alex Kalderimis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Authorization feature spec minor refactor
parent
428a9621
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
spec/graphql/features/authorization_spec.rb
spec/graphql/features/authorization_spec.rb
+5
-5
No files found.
spec/graphql/features/authorization_spec.rb
View file @
517dd200
...
...
@@ -13,10 +13,10 @@ RSpec.describe 'Gitlab::Graphql::Authorize' do
let
(
:result
)
do
schema
=
empty_schema
schema
.
use
(
Gitlab
::
Graphql
::
Authorize
)
execute_query
(
query_type
,
schema
)
[
'data'
]
execute_query
(
query_type
,
schema
)
end
subject
{
result
[
'item'
]
}
subject
{
result
.
dig
(
'data'
,
'item'
)
}
shared_examples
'authorization with a single permission'
do
it
'returns the protected field when user has permission'
do
...
...
@@ -196,7 +196,7 @@ RSpec.describe 'Gitlab::Graphql::Authorize' do
end
end
subject
{
result
.
dig
(
'item'
,
'edges'
)
}
subject
{
result
.
dig
(
'
data'
,
'
item'
,
'edges'
)
}
it
'returns only the elements visible to the user'
do
permit
(
permission_single
)
...
...
@@ -240,7 +240,7 @@ RSpec.describe 'Gitlab::Graphql::Authorize' do
end
end
subject
{
result
[
'item'
].
first
}
subject
{
result
[
'
data'
][
'
item'
].
first
}
include_examples
'authorization with a single permission'
end
...
...
@@ -285,7 +285,7 @@ RSpec.describe 'Gitlab::Graphql::Authorize' do
end
it
'renders the issues the user has access to'
do
issue_edges
=
result
[
'testProject'
][
'testIssues'
][
'edges'
]
issue_edges
=
result
[
'
data'
][
'
testProject'
][
'testIssues'
][
'edges'
]
issue_ids
=
issue_edges
.
map
{
|
issue_edge
|
issue_edge
[
'node'
]
&
.
fetch
(
'id'
)
}
expect
(
issue_edges
.
size
).
to
eq
(
visible_issues
.
size
)
...
...
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