Sha256: 847a59130d24211cdc0238d0a4f8ad21f0bce3cbc4b4ee86bc6d8511662c7890

Contents?: true

Size: 771 Bytes

Versions: 9

Compression:

Stored size: 771 Bytes

Contents

require 'spec_helper'

describe Contact do
  context "inverse" do
    before do
      @sent = Factory(:contact)
      @received = @sent.inverse!
    end

    it "should be set" do
      @sent.reload.inverse.should eq(@received)
    end
  end

  context "with message" do
    before do
      @sent = Factory(:contact, :message => 'Hello')
      @received = @sent.inverse!
    end

    it "should send to the receiver" do
      @sent.message.should == 'Hello'
      @sent.sender_subject.should eq(@received.receiver_subject)
    end
  end

  context "spurious" do
    before do
      @contact = Factory(:contact)
      @contact.inverse!
    end

    it "should not appear as pending" do
      @contact.sender.pending_contacts.should_not include(@contact)
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
social_stream-0.9.6 base/spec/models/contact_spec.rb
social_stream-base-0.9.9 spec/models/contact_spec.rb
social_stream-0.9.5 base/spec/models/contact_spec.rb
social_stream-base-0.9.8 spec/models/contact_spec.rb
social_stream-0.9.4 base/spec/models/contact_spec.rb
social_stream-0.9.3 base/spec/models/contact_spec.rb
social_stream-base-0.9.7 spec/models/contact_spec.rb
social_stream-0.9.2 base/spec/models/contact_spec.rb
social_stream-base-0.9.6 spec/models/contact_spec.rb