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
fced9678
Commit
fced9678
authored
Oct 13, 2012
by
Riyad Preukschas
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1694 from robbkidd/fix_notification_of_wall_notes
Fix notification for notes on a wall. (regression)
parents
db3d90cb
9588a232
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
app/observers/note_observer.rb
app/observers/note_observer.rb
+2
-1
spec/observers/note_observer_spec.rb
spec/observers/note_observer_spec.rb
+1
-1
No files found.
app/observers/note_observer.rb
View file @
fced9678
...
@@ -16,7 +16,8 @@ class NoteObserver < ActiveRecord::Observer
...
@@ -16,7 +16,8 @@ class NoteObserver < ActiveRecord::Observer
protected
protected
def
notify_team_of_new_note
(
note
)
def
notify_team_of_new_note
(
note
)
notify_method
=
'note_'
+
note
.
noteable_type
.
underscore
+
'_email'
note_is_on
=
note
.
noteable_type
||
'Wall'
notify_method
=
'note_'
+
note_is_on
.
underscore
+
'_email'
if
Notify
.
respond_to?
notify_method
if
Notify
.
respond_to?
notify_method
team_without_note_author
(
note
).
map
do
|
u
|
team_without_note_author
(
note
).
map
do
|
u
|
...
...
spec/observers/note_observer_spec.rb
View file @
fced9678
...
@@ -80,7 +80,7 @@ describe NoteObserver do
...
@@ -80,7 +80,7 @@ describe NoteObserver do
subject
.
send
(
:notify_team_of_new_note
,
note
)
subject
.
send
(
:notify_team_of_new_note
,
note
)
end
end
it
'a wall'
do
it
'a wall'
do
note
.
stub
(
:noteable_type
).
and_return
(
'Wall'
)
note
.
stub
(
:noteable_type
).
and_return
(
nil
)
Notify
.
should_receive
(
:note_wall_email
).
twice
.
and_return
(
double
(
deliver:
true
))
Notify
.
should_receive
(
:note_wall_email
).
twice
.
and_return
(
double
(
deliver:
true
))
subject
.
send
(
:notify_team_of_new_note
,
note
)
subject
.
send
(
:notify_team_of_new_note
,
note
)
...
...
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