refactor observers test since email logic moved to service
This commit is contained in:
parent
ce0945efcd
commit
3728c4904e
7 changed files with 19 additions and 164 deletions
|
@ -1,4 +1,4 @@
|
|||
class ActivityObserver < ActiveRecord::Observer
|
||||
class ActivityObserver < BaseObserver
|
||||
observe :issue, :merge_request, :note, :milestone
|
||||
|
||||
def after_create(record)
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
class BaseObserver < ActiveRecord::Observer
|
||||
protected
|
||||
|
||||
def notification
|
||||
NotificationService.new
|
||||
end
|
||||
|
|
|
@ -108,4 +108,12 @@ class NotificationService
|
|||
Notify.delay.note_commit_email(note.commit_author.id, note.id)
|
||||
end
|
||||
end
|
||||
|
||||
def new_team_member(users_project)
|
||||
Notify.delay.project_access_granted_email(users_project.id)
|
||||
end
|
||||
|
||||
def update_team_member(users_project)
|
||||
Notify.delay.project_access_granted_email(users_project.id)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue