Sha256: 2e23780d1b9a40e7cede9caad2eaa6492a24e285004e493ecfcb3285677978c3

Contents?: true

Size: 718 Bytes

Versions: 5

Compression:

Stored size: 718 Bytes

Contents

require 'minitest_helper'

module Commontator
  describe CommentObserver do
    before do
      setup_model_spec
      @comment_observer = CommentObserver.instance
      @thread.subscribe(@user)
      @comment = Comment.new
      @comment.thread = @thread
      @comment.creator = @user
      @comment.body = 'Something'
      @comment.save!
    end
    
    it 'wont send mail unless recipients not empty' do
      @comment_observer.after_create(@comment).must_be_nil
    end
    
    it 'must send mail if recipients not empty' do
      @user2 = DummyUser.create
      @thread.subscribe(@user2)
      @comment.reload
      @comment_observer.after_create(@comment).must_be_instance_of Mail::Message
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
commontator-2.0.2 spec/app/models/commontator/comment_observer_spec.rb
commontator-2.0.1 spec/app/models/commontator/comment_observer_spec.rb
commontator-2.0.0 spec/app/models/commontator/comment_observer_spec.rb
commontator-1.1.3 spec/app/models/commontator/comment_observer_spec.rb
commontator-1.1.2 spec/app/models/commontator/comment_observer_spec.rb