Sha256: d72c271ecdceabc0d2895e8c7f2ac076378ce6a36c2dbbce98aeb56fbecece06

Contents?: true

Size: 822 Bytes

Versions: 12

Compression:

Stored size: 822 Bytes

Contents

require File.dirname(__FILE__) + '/../test_helper'
require 'comment_mailer'

class CommentMailerTest < ActiveSupport::TestCase

  context "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
    
    should "send new comment email" do
      comment = Factory(:comment)
      response = CommentMailer.deliver_new_comment(comment)
      assert !ActionMailer::Base.deliveries.empty?, "No email was sent"
      email = ActionMailer::Base.deliveries.last
      assert_equal [comment.user.email], email.to
      assert_equal [GlobalConfig.from_email], email.from
    end
    
  end  
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
muck-comments-0.1.21 test/rails_root/test/unit/comment_mailer_test.rb
muck-comments-0.1.20 test/rails_root/test/unit/comment_mailer_test.rb
muck-comments-0.1.19 test/rails_root/test/unit/comment_mailer_test.rb
muck-comments-0.1.18 test/rails_root/test/unit/comment_mailer_test.rb
muck-comments-0.1.17 test/rails_root/test/unit/comment_mailer_test.rb
muck-comments-0.1.16 test/rails_root/test/unit/comment_mailer_test.rb
muck-comments-0.1.15 test/rails_root/test/unit/comment_mailer_test.rb
muck-comments-0.1.14 test/rails_root/test/unit/comment_mailer_test.rb
muck-comments-0.1.13 test/rails_root/test/unit/comment_mailer_test.rb
muck-comments-0.1.12 test/rails_root/test/unit/comment_mailer_test.rb
muck-comments-0.1.11 test/rails_root/test/unit/comment_mailer_test.rb
muck-comments-0.1.10 test/rails_root/test/unit/comment_mailer_test.rb