diff options
-rw-r--r-- | spec/services/notification_recipient_service_spec.rb | 22 |
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 |