Sha256: 290f24c9ec7cd2667ab190a81043baf6cfdc6fa6f01c4c53eaafeeaaa30d276f

Contents?: true

Size: 603 Bytes

Versions: 31

Compression:

Stored size: 603 Bytes

Contents

# frozen_string_literal: true

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

31 entries across 31 versions & 2 rubygems

Version Path
decidim-comments-0.7.4 lib/decidim/comments/test/factories.rb
decidim-comments-0.7.3 lib/decidim/comments/test/factories.rb
decidim-comments-0.7.2 lib/decidim/comments/test/factories.rb
decidim-comments-0.7.1 lib/decidim/comments/test/factories.rb
decidim-comments-0.7.0 lib/decidim/comments/test/factories.rb
decidim-comments-0.6.8 lib/decidim/comments/test/factories.rb
decidim-0.6.8 decidim-comments/lib/decidim/comments/test/factories.rb
decidim-comments-0.6.7 lib/decidim/comments/test/factories.rb
decidim-0.6.7 decidim-comments/lib/decidim/comments/test/factories.rb
decidim-comments-0.6.6 lib/decidim/comments/test/factories.rb
decidim-0.6.6 decidim-comments/lib/decidim/comments/test/factories.rb
decidim-comments-0.6.5 lib/decidim/comments/test/factories.rb
decidim-0.6.5 decidim-comments/lib/decidim/comments/test/factories.rb
decidim-comments-0.6.4 lib/decidim/comments/test/factories.rb
decidim-0.6.4 decidim-comments/lib/decidim/comments/test/factories.rb
decidim-comments-0.6.3 lib/decidim/comments/test/factories.rb
decidim-0.6.3 decidim-comments/lib/decidim/comments/test/factories.rb
decidim-comments-0.6.2 lib/decidim/comments/test/factories.rb
decidim-0.6.2 decidim-comments/lib/decidim/comments/test/factories.rb
decidim-comments-0.6.1 lib/decidim/comments/test/factories.rb