Sha256: d30354ae4b1b2fc9db5f900c029ef5233cf07dce89454cf654151977c5f5c7b6

Contents?: true

Size: 831 Bytes

Versions: 10

Compression:

Stored size: 831 Bytes

Contents

# frozen_string_literal: true

require "decidim/faker/localized"
require "decidim/core/test/factories"
require "decidim/participatory_processes/test/factories"

FactoryBot.define do
  factory :post_component, parent: :component do
    name { Decidim::Components::Namer.new(participatory_space.organization.available_locales, :blogs).i18n_name }
    manifest_name :blogs
    participatory_space { create(:participatory_process, :with_steps, organization: organization) }
  end

  factory :post, class: "Decidim::Blogs::Post" do
    title { Decidim::Faker::Localized.sentence(3) }
    body { Decidim::Faker::Localized.wrapped("<p>", "</p>") { Decidim::Faker::Localized.sentence(4) } }
    component { build(:component, manifest_name: "blogs") }
    author { build(:user, :confirmed, organization: component.organization) }
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
decidim-blogs-0.13.1 lib/decidim/blogs/test/factories.rb
decidim-blogs-0.12.2 lib/decidim/blogs/test/factories.rb
decidim-blogs-0.13.0 lib/decidim/blogs/test/factories.rb
decidim-blogs-0.12.1 lib/decidim/blogs/test/factories.rb
decidim-blogs-0.13.0.pre1 lib/decidim/blogs/test/factories.rb
decidim-blogs-0.12.0 lib/decidim/blogs/test/factories.rb
decidim-blogs-0.11.2 lib/decidim/blogs/test/factories.rb
decidim-blogs-0.12.0.pre lib/decidim/blogs/test/factories.rb
decidim-blogs-0.11.1 lib/decidim/blogs/test/factories.rb
decidim-blogs-0.11.0.pre1 lib/decidim/blogs/test/factories.rb