diff --git a/spec/factories/federal_tax_brackets.rb b/spec/factories/federal_tax_brackets.rb index 84f45c7..e19c4b9 100644 --- a/spec/factories/federal_tax_brackets.rb +++ b/spec/factories/federal_tax_brackets.rb @@ -24,9 +24,12 @@ # fk_rails_... (federal_tax_table_type_id => federal_tax_table_types.id) # FactoryBot.define do + # tax_brackets = 10% on first $1,000, 15% from $1,001 to $100,000, 25% from $100,001 to $500,000 factory :federal_tax_bracket do + federal_tax_table_type + tier { "Tier 1" } bottom_range_cents { 0 } top_range_cents { 100_000 } # $1,000.00 diff --git a/spec/factories/federal_tax_table_types.rb b/spec/factories/federal_tax_table_types.rb index 365ffd7..940b9c8 100644 --- a/spec/factories/federal_tax_table_types.rb +++ b/spec/factories/federal_tax_table_types.rb @@ -9,5 +9,26 @@ # FactoryBot.define do factory :federal_tax_table_type do + filing_status { "single" } + + trait :married_filing_jointly do + filing_status { "married_filing_jointly" } + end + + trait :married_filing_separately do + filing_status { "married_filing_separately" } + end + + trait :head_of_household do + filing_status { "head_of_household" } + end + + trait :with_all_statuses do + after :create do |_record| + create(:federal_tax_table_type, :married_filing_jointly) + create(:federal_tax_table_type, :married_filing_separately) + create(:federal_tax_table_type, :head_of_household) + end + end end end diff --git a/spec/features/federal_tax_brackets/edit.html.tailwindcss_spec.rb b/spec/features/federal_tax_brackets/edit.html.tailwindcss_spec.rb index a1fc918..6fae116 100644 --- a/spec/features/federal_tax_brackets/edit.html.tailwindcss_spec.rb +++ b/spec/features/federal_tax_brackets/edit.html.tailwindcss_spec.rb @@ -7,7 +7,8 @@ bottom_range: 1, top_range: 1, rate: 1.5, - cumulative: 1 + cumulative: 1, + federal_tax_table_type: create(:federal_tax_table_type) ) }