Sha256: c742736c9c7486638e22a4181732134ad47856b6bcfe93a8a22156959f8ccc1d
Contents?: true
Size: 681 Bytes
Versions: 14
Compression:
Stored size: 681 Bytes
Contents
# frozen_string_literal: true require "decidim/core/test/factories" require "decidim/admin/test/factories" FactoryGirl.define do factory :comment, class: "Decidim::Comments::Comment" do author { build(:user, organization: commentable.organization) } commentable { build(:dummy_resource) } root_commentable { commentable } body { Faker::Lorem.paragraph } end factory :comment_vote, class: "Decidim::Comments::CommentVote" do comment { build(:comment) } author { build(:user, organization: comment.organization) } weight { [-1, 1].sample } trait :up_vote do weight 1 end trait :down_vote do weight(-1) end end end
Version data entries
14 entries across 14 versions & 2 rubygems