Sha256: a79e6c67412ca949b2644cb88b9f01238add20207fd972f56370f669ee632e2d

Contents?: true

Size: 818 Bytes

Versions: 14

Compression:

Stored size: 818 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../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

14 entries across 14 versions & 1 rubygems

Version Path
social_stream-base-0.9.5 spec/models/contact_spec.rb
social_stream-base-0.9.4 spec/models/contact_spec.rb
social_stream-base-0.9.3 spec/models/contact_spec.rb
social_stream-base-0.9.2 spec/models/contact_spec.rb
social_stream-base-0.9.1 spec/models/contact_spec.rb
social_stream-base-0.9.0 spec/models/contact_spec.rb
social_stream-base-0.8.2 spec/models/contact_spec.rb
social_stream-base-0.8.1 spec/models/contact_spec.rb
social_stream-base-0.8.0 spec/models/contact_spec.rb
social_stream-base-0.7.11 spec/models/contact_spec.rb
social_stream-base-0.7.10 spec/models/contact_spec.rb
social_stream-base-0.7.9 spec/models/contact_spec.rb
social_stream-base-0.7.8 spec/models/contact_spec.rb
social_stream-base-0.7.7 spec/models/contact_spec.rb