From 3e0bab98e91b3030921264dc7641f2e8498d84c7 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Mon, 10 Feb 2025 07:04:49 -0800 Subject: [PATCH] Add GridWeapons and Parties factories --- spec/factories/grid_weapons.rb | 14 +++++++++++++- spec/factories/parties.rb | 18 +++++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/spec/factories/grid_weapons.rb b/spec/factories/grid_weapons.rb index a181f98..765b70c 100644 --- a/spec/factories/grid_weapons.rb +++ b/spec/factories/grid_weapons.rb @@ -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 diff --git a/spec/factories/parties.rb b/spec/factories/parties.rb index 03627dd..5480b4d 100644 --- a/spec/factories/parties.rb +++ b/spec/factories/parties.rb @@ -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