diff options
author | Rémy Coutable <remy@rymai.me> | 2016-03-15 18:08:45 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-03-15 18:08:45 +0000 |
commit | bc590ce63bd2f1af5545b648e6d028a557e7c792 (patch) | |
tree | 572c40bc0e3dc45f6970247073c4423284591c92 /spec/support | |
parent | ac8c6f24e3070c28ab6f246599c95fd8f3b7e3a5 (diff) | |
parent | e90d6ec1d83ff86743e70931b49647eaf3e3e67a (diff) | |
download | gitlab-ce-bc590ce63bd2f1af5545b648e6d028a557e7c792.tar.gz |
Merge branch '12743-subscribe-to-label' into 'master'
Allow subscribing to labels
This implement #12743 and supersedes !2799 (thanks @timothyandrew!).
- Subscribe (and unsubscribe) for labels
- When an issue/merge request is created, notify all subscribers of all its labels
- When an issue/merge request is edited, notify all subscribers of all its newly-added labels
## Done
- [x] Verify that a user is signed in to subscribe/unsubscribe from a label.
- [x] Merge conflicts
- [x] Integration tests
- [x] `issuable.subscribed?` should check subscribers and participants
- [x] When an issuable is relabeled, notify subscribers of the *newly added* labels only
- [x] Screenshots:
### Labels page
![Screen_Shot_2016-03-07_at_19.05.44](/uploads/3e69064e9e1a06ee2e27c778776c1407/Screen_Shot_2016-03-07_at_19.05.44.png)
### HTML email
![Screen_Shot_2016-03-07_at_19.07.36](/uploads/e484e06366a738385f1f6d71b52eecf7/Screen_Shot_2016-03-07_at_19.07.36.png)
### Plain text email
![Screen_Shot_2016-03-07_at_19.07.50](/uploads/dc05f710a8f7ab5eae9f72aa2110e741/Screen_Shot_2016-03-07_at_19.07.50.png)
PS: I've set the milestone to 8.6 since it's getting late for 8.5...
See merge request !3115
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/email_helpers.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/support/email_helpers.rb b/spec/support/email_helpers.rb new file mode 100644 index 00000000000..a85ab22ce36 --- /dev/null +++ b/spec/support/email_helpers.rb @@ -0,0 +1,13 @@ +module EmailHelpers + def sent_to_user?(user) + ActionMailer::Base.deliveries.map(&:to).flatten.count(user.email) == 1 + end + + def should_email(user) + expect(sent_to_user?(user)).to be_truthy + end + + def should_not_email(user) + expect(sent_to_user?(user)).to be_falsey + end +end |