Add GridWeapons and Parties factories

This commit is contained in:
Justin Edmund 2025-02-10 07:04:49 -08:00
parent 1d1c088e5d
commit 3e0bab98e9
2 changed files with 30 additions and 2 deletions

View file

@ -1,5 +1,17 @@
# frozen_string_literal: true
FactoryBot.define do
factory :grid_weapon do
# Associations: assumes that factories for :party and :weapon are defined.
association :party
association :weapon
# Default attributes
position { 0 }
uncap_level { 3 }
transcendence_step { 0 }
mainhand { false }
# Optional associations for weapon keys and awakening are left as nil by default.
end
end

View file

@ -1,5 +1,21 @@
# frozen_string_literal: true
FactoryBot.define do
factory :party do
association :user
# Use a sequence for unique party names (optional).
sequence(:name) { |n| "Party #{n}" }
description { Faker::Lorem.sentence }
extra { false }
full_auto { false }
auto_guard { false }
charge_attack { true }
clear_time { 0 }
button_count { 0 }
chain_count { 0 }
turn_count { 0 }
visibility { 1 }
# Note: Shortcode and edit_key will be auto-generated via before_create callbacks.
end
end