Sha256: efa00b894bb102b10db28adab6471073ee1b97a825514985bedc55c654b45b70
Contents?: true
Size: 1.3 KB
Versions: 4
Compression:
Stored size: 1.3 KB
Contents
Factory.define :tie do |t| t.sender { |s| Factory(:user).actor } t.receiver { |r| Factory(:user).actor } t.relation { |r| Relation.mode('User', 'User').strongest } end # UserToUser ties Factory.define :friend, :parent => :tie do |t| t.relation { |r| Relation.mode('User', 'User').find_by_name('friend') } end Factory.define :friend_request, :parent => :tie do |t| t.relation { |r| Relation.mode('User', 'User').find_by_name('friend_request') } end Factory.define :public, :parent => :tie do |t| t.relation { |r| Relation.mode('User', 'User').find_by_name('public') } end # UserToGroup ties Factory.define :u2g_tie, :parent => :tie do |t| t.receiver { |r| Factory(:group).actor } t.relation { |r| Relation.mode('User', 'Group').strongest } end Factory.define :member, :parent => :u2g_tie do |t| t.relation { |r| Relation.mode('User', 'Group').find_by_name('member') } end Factory.define :follower, :parent => :u2g_tie do |t| t.relation { |r| Relation.mode('User', 'Group').find_by_name('follower') } end # GroupToUser ties Factory.define :g2u_tie, :parent => :tie do |t| t.sender { |r| Factory(:group).actor } t.relation { |r| Relation.mode('Group', 'User').strongest } end Factory.define :g2u_member, :parent => :tie do |t| t.relation { |r| Relation.mode('Group', 'User').find_by_name('member') } end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
social_stream-0.2.3 | spec/factories/tie.rb |
social_stream-0.2.2 | spec/factories/tie.rb |
social_stream-0.2.1 | spec/factories/tie.rb |
social_stream-0.2.0 | spec/factories/tie.rb |