Sha256: 687f472afdd94d16f85374bf1dd6d15e1966b0a308592b9c2b6e182e7889a99d

Contents?: true

Size: 909 Bytes

Versions: 2

Compression:

Stored size: 909 Bytes

Contents

require 'rails_helper'

module Commontator
  RSpec.describe SubscriptionsMailer, type: :mailer do
    before(:each) do
      setup_mailer_spec
      @user2 = DummyUser.create
      @thread.subscribe(@user)
      @thread.subscribe(@user2)
      @comment = Comment.new
      @comment.thread = @thread
      @comment.creator = @user
      @comment.body = 'Something'
      @comment.save!
      @recipients = @thread.subscribers.reject{|s| s == @user}
    end

    it 'must create deliverable mail' do
      mail = SubscriptionsMailer.comment_created(@comment, @recipients)
      expect(mail.to).to eq I18n.t('commontator.email.undisclosed_recipients')
      expect(mail.cc).to be_nil
      expect(mail.bcc.size).to eq 1
      expect(mail.bcc).to include(@user2.email)
      expect(mail.subject).not_to be_empty
      expect(mail.body).not_to be_empty
      expect(mail.deliver_now).to eq mail
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
commontator-4.10.5 spec/mailers/commontator/subscriptions_mailer_spec.rb
commontator-4.10.4 spec/mailers/commontator/subscriptions_mailer_spec.rb