Sha256: 5e9aff19a6dcde4cd705e92cbc7fdbdc7a10ee394b1c5d4d5cd0343c956d9a4c

Contents?: true

Size: 977 Bytes

Versions: 111

Compression:

Stored size: 977 Bytes

Contents

require 'spec_helper'

describe Actor do
  it "should generate slug" do
    assert Factory(:user).actor.slug.present?
  end

  it "should generate different slug" do
    a = Factory(:user).actor
    b = Factory(:user, :name => a.name).actor

    a.name.should == b.name
    a.slug.should_not == b.slug
  end

  it "should generate relations" do
    assert Factory(:user).relation_customs.present?
  end

  context 'pending contacts' do
    it 'should not include self' do
      a = Factory(:user).actor
      c = a.contact_to!(a)

      a.pending_contacts.should_not include(c)
    end
  end

  it 'should generate suggestion' do
    10.times do
      Factory(:user)
    end

    sgs = Factory(:user).suggestions(5)

    sgs.size.should be(5)

    sgs_names = sgs.map{ |s| s.receiver_subject.name }.compact

    sgs.size.should be(5)
  end

  it "should be destroyed" do
    u = Factory(:user)
    a = u.actor

    u.destroy

    Actor.find_by_id(a.id).should be_nil
  end
end

Version data entries

111 entries across 111 versions & 2 rubygems

Version Path
social_stream-2.2.2 base/spec/models/actor_spec.rb
social_stream-base-2.2.2 spec/models/actor_spec.rb
social_stream-2.2.1 base/spec/models/actor_spec.rb
social_stream-base-2.2.1 spec/models/actor_spec.rb
social_stream-2.2.0 base/spec/models/actor_spec.rb
social_stream-base-2.2.0 spec/models/actor_spec.rb
social_stream-2.1.1 base/spec/models/actor_spec.rb
social_stream-2.1.0 base/spec/models/actor_spec.rb
social_stream-base-2.1.0 spec/models/actor_spec.rb
social_stream-2.0.4 base/spec/models/actor_spec.rb
social_stream-base-2.0.4 spec/models/actor_spec.rb
social_stream-2.0.3 base/spec/models/actor_spec.rb
social_stream-base-2.0.3 spec/models/actor_spec.rb
social_stream-2.0.2 base/spec/models/actor_spec.rb
social_stream-base-2.0.2 spec/models/actor_spec.rb
social_stream-2.0.1 base/spec/models/actor_spec.rb
social_stream-base-2.0.1 spec/models/actor_spec.rb
social_stream-2.0.0 base/spec/models/actor_spec.rb
social_stream-base-2.0.0 spec/models/actor_spec.rb
social_stream-2.0.0.beta3 base/spec/models/actor_spec.rb