Sha256: a310965a8a74aac372d722662157d76d028b545d24405d7536b9c0369f3b3012

Contents?: true

Size: 714 Bytes

Versions: 8

Compression:

Stored size: 714 Bytes

Contents

require 'spec_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

8 entries across 8 versions & 1 rubygems

Version Path
commontator-2.0.2 spec/app/models/commontator/comment_observer_spec.rb~
commontator-4.0.1 spec/app/models/commontator/comment_observer_spec.rb~
commontator-4.0.0 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~
commontator-1.1.1 spec/app/models/commontator/comment_observer_spec.rb