Sha256: 6afe1272a3b189cd27ffd60f6f112583c65fd12d242b56f4ca8a1cd63cd458d4

Contents?: true

Size: 984 Bytes

Versions: 11

Compression:

Stored size: 984 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('friend') }
end

Factory.define :acquaintance, :parent => :tie do |t|
  t.after_build { |u| u.relation = u.sender.relation('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('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('partner') }
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
social_stream-0.4.3 spec/factories/tie.rb
social_stream-0.4.2 spec/factories/tie.rb
social_stream-0.4.1 spec/factories/tie.rb
social_stream-0.4.0 spec/factories/tie.rb
social_stream-0.3.6 spec/factories/tie.rb
social_stream-0.3.5 spec/factories/tie.rb
social_stream-0.3.4 spec/factories/tie.rb
social_stream-0.3.3 spec/factories/tie.rb
social_stream-0.3.2 spec/factories/tie.rb
social_stream-0.3.1 spec/factories/tie.rb
social_stream-0.3.0 spec/factories/tie.rb