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
Kazuhiko Shiozaki
gitlab-ce
Commits
1f0b8c32
Commit
1f0b8c32
authored
Jan 13, 2016
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spec for Note#cross_reference_not_visible_for?
parent
5e452d37
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
spec/models/note_spec.rb
spec/models/note_spec.rb
+24
-0
No files found.
spec/models/note_spec.rb
View file @
1f0b8c32
...
@@ -178,6 +178,30 @@ describe Note, models: true do
...
@@ -178,6 +178,30 @@ describe Note, models: true do
end
end
end
end
describe
"cross_reference_not_visible_for?"
do
let
(
:private_user
)
{
create
(
:user
)
}
let
(
:private_project
)
{
create
(
:project
,
namespace:
private_user
.
namespace
).
tap
{
|
p
|
p
.
team
<<
[
private_user
,
:master
]
}
}
let
(
:private_issue
)
{
create
(
:issue
,
project:
private_project
)
}
let
(
:ext_proj
)
{
create
(
:project
,
:public
)
}
let
(
:ext_issue
)
{
create
(
:issue
,
project:
ext_proj
)
}
let
(
:note
)
{
create
:note
,
noteable:
ext_issue
,
project:
ext_proj
,
note:
"mentioned in issue
#{
private_issue
.
to_reference
(
ext_proj
)
}
"
,
system:
true
}
it
"returns true"
do
expect
(
note
.
cross_reference_not_visible_for?
(
ext_issue
.
author
)).
to
be_truthy
end
it
"returns false"
do
expect
(
note
.
cross_reference_not_visible_for?
(
private_user
)).
to
be_falsy
end
end
describe
"set_award!"
do
describe
"set_award!"
do
let
(
:issue
)
{
create
:issue
}
let
(
:issue
)
{
create
:issue
}
...
...
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