summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Nelson <stuartnelson3@gmail.com>2018-02-14 10:16:37 +0100
committerSean McGivern <sean@gitlab.com>2018-03-26 08:10:58 +0100
commitf4c8517fec6d53e079f465d594ddef531e12c0af (patch)
treebcfcb6fdae44403eaf215de7e8d124d5a61c6ed9
parenta11b4ee683bb20a8795464e0b033c21f22bc7975 (diff)
downloadgitlab-ce-stuartnelson3/gitlab-ce-stn/issue-due-email.tar.gz
Add failing notification_recipient_service specstuartnelson3/gitlab-ce-stn/issue-due-email
-rw-r--r--spec/services/notification_recipient_service_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/services/notification_recipient_service_spec.rb b/spec/services/notification_recipient_service_spec.rb
new file mode 100644
index 00000000000..7d826377579
--- /dev/null
+++ b/spec/services/notification_recipient_service_spec.rb
@@ -0,0 +1,22 @@
+require 'spec_helper'
+
+describe NotificationRecipientService do
+ describe 'build_recipients' do
+ it 'due_date' do
+ # These folks are being filtered out because they can't receive notifications
+ # notification_recipient.rb#85
+ user = create(:user)
+ assignee = create(:user)
+ issue = create(:issue, :opened, due_date: Date.today, author: user, assignees: [assignee])
+
+ recipients = described_class.build_recipients(
+ issue,
+ issue.author,
+ action: "due_date",
+ skip_current_user: false
+ )
+
+ expect(recipients).to match_array([user, assignee])
+ end
+ end
+end