Sha256: d97146304d89f4c6fe202bbc5555655d8e1f206f54f0c47607116dcf8648934d

Contents?: true

Size: 839 Bytes

Versions: 3

Compression:

Stored size: 839 Bytes

Contents

require 'test_helper'

module Commontator
  describe SubscriptionsMailer do
    before 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.active_subscribers.reject{|s| s == @user}
    end
    
    it 'must create deliverable mail' do
      mail = SubscriptionsMailer.comment_created(@comment, @recipients)
      mail.must_be_instance_of Mail::Message
      mail.to.must_be_nil
      mail.cc.must_be_nil
      mail.bcc.size.must_equal 1
      mail.bcc.must_include @user2.email
      mail.subject.wont_be_empty
      mail.body.wont_be_empty
      mail.deliver.must_equal mail
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
commontator-2.0.2 spec/app/mailers/commontator/subscriptions_mailer_spec.rb~
commontator-4.0.1 spec/app/mailers/commontator/subscriptions_mailer_spec.rb~
commontator-4.0.0 spec/app/mailers/commontator/subscriptions_mailer_spec.rb~