Sha256: ab06aec71c126e85277ee5597c7bcb7980bcd49806b72fe31370d79e27662b2d

Contents?: true

Size: 1.43 KB

Versions: 21

Compression:

Stored size: 1.43 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
  
    it "should be able to be marked as read" do
    @conversation.move_to_trash(@entity1)
  end
  
  it "should be able to be marked as unread" do
    @conversation.move_to_trash(@entity1)
    @conversation.untrash(@entity1)
  end
  
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
mailboxer-0.6.0 spec/models/conversation_spec.rb
mailboxer-0.5.5 spec/models/conversation_spec.rb
mailboxer-0.5.4 spec/models/conversation_spec.rb
mailboxer-0.5.3 spec/models/conversation_spec.rb
mailboxer-0.5.2 spec/models/conversation_spec.rb
mailboxer-0.5.1 spec/models/conversation_spec.rb
mailboxer-0.5.0 spec/models/conversation_spec.rb
mailboxer-0.4.3 spec/models/conversation_spec.rb
mailboxer-0.4.2 spec/models/conversation_spec.rb
mailboxer-0.4.1 spec/models/conversation_spec.rb
mailboxer-0.4.0 spec/models/conversation_spec.rb
mailboxer-0.3.3 spec/models/conversation_spec.rb
mailboxer-0.3.2 spec/models/conversation_spec.rb
mailboxer-0.3.1 spec/models/conversation_spec.rb
mailboxer-0.3.0 spec/models/conversation_spec.rb
mailboxer-0.2.5 spec/models/conversation_spec.rb
mailboxer-0.2.4 spec/models/conversation_spec.rb
mailboxer-0.2.3 spec/models/conversation_spec.rb
mailboxer-0.2.2 spec/models/conversation_spec.rb
mailboxer-0.2.1 spec/models/conversation_spec.rb