Commit 14b68586b8c2187d918a2d6c8cad51a72e2b51cd
Exists in
spb-stable
and in
3 other branches
Merge branch 'no_email_on_notification_level_change' into 'master'
Don't send emails on notification level change
Showing
2 changed files
with
2 additions
and
2 deletions
Show diff stats
app/observers/users_project_observer.rb
| ... | ... | @@ -10,7 +10,7 @@ class UsersProjectObserver < BaseObserver |
| 10 | 10 | end |
| 11 | 11 | |
| 12 | 12 | def after_update(users_project) |
| 13 | - notification.update_team_member(users_project) | |
| 13 | + notification.update_team_member(users_project) if users_project.project_access_changed? | |
| 14 | 14 | end |
| 15 | 15 | |
| 16 | 16 | def after_destroy(users_project) | ... | ... |
spec/observers/users_project_observer_spec.rb
| ... | ... | @@ -21,7 +21,7 @@ describe UsersProjectObserver do |
| 21 | 21 | |
| 22 | 22 | it "should send email to user" do |
| 23 | 23 | subject.should_receive(:notification) |
| 24 | - @users_project.update_attribute(:project_access, UsersProject::MASTER) | |
| 24 | + @users_project.update_attribute(:project_access, UsersProject::OWNER) | |
| 25 | 25 | end |
| 26 | 26 | |
| 27 | 27 | it "should not called after UsersProject destroyed" do | ... | ... |