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
1af65c96
Commit
1af65c96
authored
Dec 06, 2013
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid duplicate group membership emails
parent
845b98ec
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
app/observers/users_group_observer.rb
app/observers/users_group_observer.rb
+1
-1
spec/observers/users_group_observer_spec.rb
spec/observers/users_group_observer_spec.rb
+5
-0
No files found.
app/observers/users_group_observer.rb
View file @
1af65c96
...
...
@@ -4,6 +4,6 @@ class UsersGroupObserver < BaseObserver
end
def
after_update
(
membership
)
notification
.
update_group_member
(
membership
)
notification
.
update_group_member
(
membership
)
if
membership
.
group_access_changed?
end
end
spec/observers/users_group_observer_spec.rb
View file @
1af65c96
...
...
@@ -23,5 +23,10 @@ describe UsersGroupObserver do
subject
.
should_receive
(
:notification
)
@membership
.
update_attribute
(
:group_access
,
UsersGroup
::
MASTER
)
end
it
"does not send an email when the access level has not changed"
do
subject
.
should_not_receive
(
:notification
)
@membership
.
update_attribute
(
:group_access
,
UsersGroup
::
OWNER
)
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