Sha256: 24495fad8666bef950823c2624a5135ef33526f498a4839892c816567a75a3d7

Contents?: true

Size: 713 Bytes

Versions: 3

Compression:

Stored size: 713 Bytes

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe CommentMailer do

  describe "deliver emails" do

    def setup
      ActionMailer::Base.delivery_method = :test
      ActionMailer::Base.perform_deliveries = true
      ActionMailer::Base.deliveries = []
      @expected = TMail::Mail.new
      @expected.set_content_type "text", "plain", { "charset" => 'utf-8' }
    end
    
    it "should send new comment email" do
      comment = Factory(:comment)
      email = CommentMailer.new_comment(comment).deliver
      ActionMailer::Base.deliveries.should_not be_empty
      email.to.should == [comment.user.email]
      email.from.should == [MuckEngine.configuration.from_email]
    end
    
  end  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
muck-comments-3.0.2 test/rails_test/spec/mailers/comment_mailer_spec.rb
muck-comments-3.0.1 test/rails_test/spec/mailers/comment_mailer_spec.rb
muck-comments-3.0.0 test/rails_test/spec/mailers/comment_mailer_spec.rb