Sha256: a54872bb4b9c516f08e3307d9fec549d3d898c138b625cd4af4a8f0ce9e058bb

Contents?: true

Size: 1.2 KB

Versions: 7

Compression:

Stored size: 1.2 KB

Contents

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

describe Conversation do
  
  before do
    @entity1 = Factory(:user)
    @entity2 = Factory(:user)
    @receipt1 = @entity1.send_message(@entity2,"Body","Subject")
    @receipt2 = @entity2.reply_to_all(@receipt1,"Reply body 1")
    @receipt3 = @entity1.reply_to_all(@receipt2,"Reply body 2")
    @receipt4 = @entity2.reply_to_all(@receipt3,"Reply body 3")
    @message1 = @receipt1.notification
    @message4 = @receipt4.notification
    @conversation = @message1.conversation
  end
  
  it "should have proper original message" do
    @conversation.original_message.should==@message1
  end
  
  it "should have proper originator (first sender)" do
    @conversation.originator.should==@entity1
  end
  
  it "should have proper last message" do
    @conversation.last_message.should==@message4
  end
  
  it "should have proper last sender" do
    @conversation.last_sender.should==@entity2
  end
  
  it "should have all conversation users" do   
    @conversation.recipients.count.should==2
    @conversation.recipients.count.should==2
    @conversation.recipients.count(@entity1).should==1
    @conversation.recipients.count(@entity2).should==1
  end
  
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mailboxer-0.1.4 spec/models/conversation_spec.rb
mailboxer-0.1.3 spec/models/conversation_spec.rb
mailboxer-0.1.2 spec/models/conversation_spec.rb
mailboxer-0.1.1 spec/models/conversation_spec.rb
mailboxer-0.1.0 spec/models/conversation_spec.rb
mailboxer-0.0.16 spec/models/conversation_spec.rb
mailboxer-0.0.15 spec/models/conversation_spec.rb