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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
4fb46624
Commit
4fb46624
authored
Jul 03, 2018
by
Reuben Pereira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a spec for a user viewing a reference to a private project
parent
b74ed743
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
spec/lib/banzai/reference_parser/project_parser_spec.rb
spec/lib/banzai/reference_parser/project_parser_spec.rb
+20
-2
No files found.
spec/lib/banzai/reference_parser/project_parser_spec.rb
View file @
4fb46624
...
@@ -14,7 +14,7 @@ describe Banzai::ReferenceParser::ProjectParser do
...
@@ -14,7 +14,7 @@ describe Banzai::ReferenceParser::ProjectParser do
it
'returns an Array of projects'
do
it
'returns an Array of projects'
do
link
[
'data-project'
]
=
project
.
id
.
to_s
link
[
'data-project'
]
=
project
.
id
.
to_s
expect
(
subject
.
referenced_by
([
link
])).
to
eq
([
project
])
expect
(
subject
.
gather_references
([
link
])).
to
eq
([
project
])
end
end
end
end
...
@@ -22,7 +22,25 @@ describe Banzai::ReferenceParser::ProjectParser do
...
@@ -22,7 +22,25 @@ describe Banzai::ReferenceParser::ProjectParser do
it
'returns an empty Array'
do
it
'returns an empty Array'
do
link
[
'data-project'
]
=
''
link
[
'data-project'
]
=
''
expect
(
subject
.
referenced_by
([
link
])).
to
eq
([])
expect
(
subject
.
gather_references
([
link
])).
to
eq
([])
end
end
context
'using a private project ID'
do
it
'returns an empty Array when unauthorized'
do
private_project
=
create
(
:project
,
:private
)
link
[
'data-project'
]
=
private_project
.
id
.
to_s
expect
(
subject
.
gather_references
([
link
])).
to
eq
([])
end
it
'returns an Array when authorized'
do
private_project
=
create
(
:project
,
:private
,
namespace:
user
.
namespace
)
link
[
'data-project'
]
=
private_project
.
id
.
to_s
expect
(
subject
.
gather_references
([
link
])).
to
eq
([
private_project
])
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