From 1661c91a5b2ed7b850a0bb376d70cb5df36bd68e Mon Sep 17 00:00:00 2001 From: Glenn Jackman Date: Wed, 18 Dec 2024 22:06:53 -0500 Subject: [PATCH] the voyage continues... --- test/models/badges/larisa_latynina_badge_test.rb | 2 +- test/models/badges/paavo_nurmi_badge_test.rb | 2 +- test/models/badges/participant_in_48_in_24_badge_test.rb | 5 ++++- test/models/badges/usain_bolt_badge_test.rb | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/test/models/badges/larisa_latynina_badge_test.rb b/test/models/badges/larisa_latynina_badge_test.rb index e69b6f0d8a..ec15dca365 100644 --- a/test/models/badges/larisa_latynina_badge_test.rb +++ b/test/models/badges/larisa_latynina_badge_test.rb @@ -42,7 +42,7 @@ class Badge::LarisaLatyninaBadgeTest < ActiveSupport::TestCase # One gold medal week_1[:featured_tracks].each do |track_slug| - exercise = create(:practice_exercise, track: tracks[track_slug], slug: week_1[:slug]) + exercise = create(:practice_exercise, track: tracks[track_slug.to_sym], slug: week_1[:slug]) create(:practice_solution, :published, user:, track: tracks[track_slug.to_sym], exercise:, published_at: Time.utc(2024, SecureRandom.rand(1..12), SecureRandom.rand(1..28))) end diff --git a/test/models/badges/paavo_nurmi_badge_test.rb b/test/models/badges/paavo_nurmi_badge_test.rb index 99508ca389..272a667494 100644 --- a/test/models/badges/paavo_nurmi_badge_test.rb +++ b/test/models/badges/paavo_nurmi_badge_test.rb @@ -42,7 +42,7 @@ class Badge::PaavoNurmiBadgeTest < ActiveSupport::TestCase # One gold medal week_1[:featured_tracks].each do |track_slug| - exercise = create(:practice_exercise, track: tracks[track_slug], slug: week_1[:slug]) + exercise = create(:practice_exercise, track: tracks[track_slug.to_sym], slug: week_1[:slug]) create(:practice_solution, :published, user:, track: tracks[track_slug.to_sym], exercise:, published_at: Time.utc(2024, SecureRandom.rand(1..12), SecureRandom.rand(1..28))) end diff --git a/test/models/badges/participant_in_48_in_24_badge_test.rb b/test/models/badges/participant_in_48_in_24_badge_test.rb index 48a8a00a09..b56d21253f 100644 --- a/test/models/badges/participant_in_48_in_24_badge_test.rb +++ b/test/models/badges/participant_in_48_in_24_badge_test.rb @@ -13,10 +13,13 @@ class Badge::ParticipantIn48In24BadgeTest < ActiveSupport::TestCase test "award_to?" do badge = create :participant_in_48_in_24_badge + tracks = {} + leap = {} + %i[csharp tcl wren].each do |t| tracks[t] = create(:track, slug: t.to_s) leap[t] = create(:practice_exercise, track: tracks[t], slug: 'leap') - end + end user = create :user # No solutions diff --git a/test/models/badges/usain_bolt_badge_test.rb b/test/models/badges/usain_bolt_badge_test.rb index 29fee8e7f0..5eada97136 100644 --- a/test/models/badges/usain_bolt_badge_test.rb +++ b/test/models/badges/usain_bolt_badge_test.rb @@ -42,7 +42,7 @@ class Badge::UsainBoltBadgeTest < ActiveSupport::TestCase # One gold medal week_1[:featured_tracks].each do |track_slug| - exercise = create(:practice_exercise, track: tracks[track_slug], slug: week_1[:slug]) + exercise = create(:practice_exercise, track: tracks[track_slug.to_sym], slug: week_1[:slug]) create(:practice_solution, :published, user:, track: tracks[track_slug.to_sym], exercise:, published_at: Time.utc(2024, SecureRandom.rand(1..12), SecureRandom.rand(1..28))) end