Sha256: f8825021ae19aea60db3ebad28ada88d478e9adc570f34f60d120a18b3c810db
Contents?: true
Size: 516 Bytes
Versions: 15
Compression:
Stored size: 516 Bytes
Contents
# frozen_string_literal: true FactoryBot.define do factory :katalyst_navigation_menu, aliases: [:navigation_menu], class: "Katalyst::Navigation::Menu" do title { Faker::Beer.unique.name } slug { title.parameterize } after(:build) do |menu, _context| menu.items.each { |item| item.menu = menu } end after(:create) do |menu, _context| menu.items_attributes = menu.items.map.with_index { |item, index| { id: item.id, index: index, depth: 0 } } menu.publish! end end end
Version data entries
15 entries across 15 versions & 1 rubygems