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
83904275
Commit
83904275
authored
May 10, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Spec SystemNoteService.cross_reference_disallowed?
parent
19142f40
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
2 deletions
+26
-2
spec/services/system_note_service_spec.rb
spec/services/system_note_service_spec.rb
+26
-2
No files found.
spec/services/system_note_service_spec.rb
View file @
83904275
...
@@ -274,8 +274,32 @@ describe SystemNoteService do
...
@@ -274,8 +274,32 @@ describe SystemNoteService do
end
end
end
end
# TODO (rspeicher)
describe
'.cross_reference_disallowed?'
do
describe
'.cross_reference_disallowed?'
context
'when mentioner is not a MergeRequest'
do
it
'is falsey'
do
mentioner
=
noteable
.
dup
expect
(
described_class
.
cross_reference_disallowed?
(
noteable
,
mentioner
)).
to
be_falsey
end
end
context
'when mentioner is a MergeRequest'
do
let
(
:mentioner
)
{
create
(
:merge_request
,
:simple
,
source_project:
project
)
}
let
(
:noteable
)
{
project
.
commit
}
it
'is truthy when noteable is in commits'
do
expect
(
mentioner
).
to
receive
(
:commits
).
and_return
([
noteable
])
expect
(
described_class
.
cross_reference_disallowed?
(
noteable
,
mentioner
)).
to
be_truthy
end
it
'is falsey when noteable is not in commits'
do
expect
(
mentioner
).
to
receive
(
:commits
).
and_return
([])
expect
(
described_class
.
cross_reference_disallowed?
(
noteable
,
mentioner
)).
to
be_falsey
end
end
end
describe
'.cross_reference_exists?'
do
describe
'.cross_reference_exists?'
do
let
(
:commit0
)
{
project
.
commit
}
let
(
:commit0
)
{
project
.
commit
}
...
...
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