Sha256: 3e120eeb9134e0cf638c4e74b1c1d47f31ee636885305e46d3627629c68432b8

Contents?: true

Size: 1009 Bytes

Versions: 5

Compression:

Stored size: 1009 Bytes

Contents

Factory.define :tie do |t|
  t.sender   { |s| Factory(:user).actor }
  t.receiver { |r| Factory(:user).actor }
end

# User ties

Factory.define :friend, :parent => :tie do |t|
  t.after_build { |u| u.relation = u.sender.relation_custom('friend') }
end

Factory.define :acquaintance, :parent => :tie do |t|
  t.after_build { |u| u.relation = u.sender.relation_custom('acquaintance') }
end

Factory.define :public, :parent => :tie do |t|
  t.after_build { |u| u.relation = u.sender.relation_public }
end

# Group ties
Factory.define :g2u_tie, :parent => :tie do |t|
  t.sender   { |u| Factory(:group).actor }
end

Factory.define :member, :parent => :g2u_tie do |t|
  t.after_build { |u| u.relation = u.sender.relation_custom('member') }
end

Factory.define :g2g_tie, :parent => :tie do |t|
  t.sender   { |u| Factory(:group).actor }
  t.receiver { |u| Factory(:group).actor }
end

Factory.define :partner, :parent => :g2g_tie do |t|
  t.after_build { |u| u.relation = u.sender.relation_custom('partner') }
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
social_stream-base-0.5.2 spec/factories/tie.rb
social_stream-base-0.5.1 spec/factories/tie.rb
social_stream-base-0.5.0 spec/factories/tie.rb
social_stream-0.4.6 spec/factories/tie.rb
social_stream-0.4.5 spec/factories/tie.rb