BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
0 deletions
+29
-0
notification_service.rb
app/services/notification_service.rb
+8
-0
application.rb
config/application.rb
+1
-0
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
...
@@ -148,6 +148,14 @@ class NotificationService
mailer
.
project_access_granted_email
(
users_project
.
id
)
mailer
.
project_access_granted_email
(
users_project
.
id
)
end
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
protected
# Get project users with WATCH notification level
# Get project users with WATCH notification level
...
...
config/application.rb
View file @
c1dd31cf
...
@@ -32,6 +32,7 @@ module Gitlab
...
@@ -32,6 +32,7 @@ module Gitlab
:project_observer
,
:project_observer
,
:system_hook_observer
,
:system_hook_observer
,
:user_observer
,
:user_observer
,
:users_group_observer
,
:users_project_observer
:users_project_observer
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# 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
...
@@ -347,4 +347,24 @@ describe Notify do
end
end
end
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
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