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
2968e87a
Commit
2968e87a
authored
Mar 02, 2017
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Disallow system notes for closed issuables"
This reverts commit
07717744
.
parent
d95ac1b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
40 deletions
+0
-40
app/services/system_note_service.rb
app/services/system_note_service.rb
+0
-1
spec/services/system_note_service_spec.rb
spec/services/system_note_service_spec.rb
+0
-39
No files found.
app/services/system_note_service.rb
View file @
2968e87a
...
@@ -385,7 +385,6 @@ module SystemNoteService
...
@@ -385,7 +385,6 @@ module SystemNoteService
# Returns Boolean
# Returns Boolean
def
cross_reference_disallowed?
(
noteable
,
mentioner
)
def
cross_reference_disallowed?
(
noteable
,
mentioner
)
return
true
if
noteable
.
is_a?
(
ExternalIssue
)
&&
!
noteable
.
project
.
jira_tracker_active?
return
true
if
noteable
.
is_a?
(
ExternalIssue
)
&&
!
noteable
.
project
.
jira_tracker_active?
return
true
if
noteable
.
is_a?
(
Issuable
)
&&
(
noteable
.
try
(
:closed?
)
||
noteable
.
try
(
:merged?
))
return
false
unless
mentioner
.
is_a?
(
MergeRequest
)
return
false
unless
mentioner
.
is_a?
(
MergeRequest
)
return
false
unless
noteable
.
is_a?
(
Commit
)
return
false
unless
noteable
.
is_a?
(
Commit
)
...
...
spec/services/system_note_service_spec.rb
View file @
2968e87a
...
@@ -418,45 +418,6 @@ describe SystemNoteService, services: true do
...
@@ -418,45 +418,6 @@ describe SystemNoteService, services: true do
to
be_truthy
to
be_truthy
end
end
end
end
context
'when noteable is an Issue'
do
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
it
'is truthy when issue is closed'
do
issue
.
close
expect
(
described_class
.
cross_reference_disallowed?
(
issue
,
project
.
commit
)).
to
be_truthy
end
it
'is falsey when issue is open'
do
expect
(
described_class
.
cross_reference_disallowed?
(
issue
,
project
.
commit
)).
to
be_falsy
end
end
context
'when noteable is a Merge Request'
do
let
(
:merge_request
)
{
create
(
:merge_request
,
:simple
,
source_project:
project
)
}
it
'is truthy when merge request is closed'
do
allow
(
merge_request
).
to
receive
(
:closed?
).
and_return
(
:true
)
expect
(
described_class
.
cross_reference_disallowed?
(
merge_request
,
project
.
commit
)).
to
be_truthy
end
it
'is truthy when merge request is merged'
do
allow
(
merge_request
).
to
receive
(
:closed?
).
and_return
(
:true
)
expect
(
described_class
.
cross_reference_disallowed?
(
merge_request
,
project
.
commit
)).
to
be_truthy
end
it
'is falsey when merge request is open'
do
expect
(
described_class
.
cross_reference_disallowed?
(
merge_request
,
project
.
commit
)).
to
be_falsy
end
end
end
end
describe
'.cross_reference_exists?'
do
describe
'.cross_reference_exists?'
do
...
...
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