Sha256: 50bf665c097b15da5f5eef0689cfee1a60230695558934dffbd16b434226a8be

Contents?: true

Size: 597 Bytes

Versions: 1

Compression:

Stored size: 597 Bytes

Contents

=begin
<%# TODO: Use the license file if no lesli.txt file found %>
<%= File.read(Lesli::Engine.root.join("lesli.txt")).to_s.force_encoding("ASCII-8BIT") %>=end

FactoryBot.define do
    factory :<%= @info[:engine_resource_code] %>, class: <%= @info[:engine_resource] %> do
        name { Faker::Company.name }

        <% @model[:columns].each do |column| %>
        <%= column[:name] %> { <%= column[:faker] %> }<% end %>

        after(:create) do |account, evaluator|
            account.user = FactoryBot.create(:user, account_id: account.id)
            account.save
        end
    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lesli-5.0.13 lib/generators/lesli/spec/templates/spec-factory.template