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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
c1dd31cf
Commit
c1dd31cf
authored
Sep 12, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable UsersGroup observer, Add group_member methods to NotificationService
parent
8589824f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
0 deletions
+29
-0
app/services/notification_service.rb
app/services/notification_service.rb
+8
-0
config/application.rb
config/application.rb
+1
-0
spec/mailers/notify_spec.rb
spec/mailers/notify_spec.rb
+20
-0
No files found.
app/services/notification_service.rb
View file @
c1dd31cf
...
...
@@ -148,6 +148,14 @@ class NotificationService
mailer
.
project_access_granted_email
(
users_project
.
id
)
end
def
new_group_member
(
users_group
)
mailer
.
group_access_granted_email
(
users_group
.
id
)
end
def
update_group_member
(
users_group
)
mailer
.
group_access_granted_email
(
users_group
.
id
)
end
protected
# Get project users with WATCH notification level
...
...
config/application.rb
View file @
c1dd31cf
...
...
@@ -32,6 +32,7 @@ module Gitlab
:project_observer
,
:system_hook_observer
,
:user_observer
,
:users_group_observer
,
:users_project_observer
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
...
...
spec/mailers/notify_spec.rb
View file @
c1dd31cf
...
...
@@ -347,4 +347,24 @@ describe Notify do
end
end
end
describe
'group access changed'
do
let
(
:group
)
{
create
(
:group
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:membership
)
{
create
(
:users_group
,
group:
group
,
user:
user
)
}
subject
{
Notify
.
group_access_granted_email
(
membership
.
id
)
}
it
'has the correct subject'
do
should
have_subject
/access to group was granted/
end
it
'contains name of project'
do
should
have_body_text
/
#{
group
.
name
}
/
end
it
'contains new user role'
do
should
have_body_text
/
#{
membership
.
human_access
}
/
end
end
end
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