Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSchierboom committed Aug 16, 2023
1 parent 34c6061 commit 919dc81
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/commands/mentor/discussion/finish_by_student.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def award_badges!
end

def award_trophies!
AwardTrophyJob.perform_later(discussion.student, track, :general, :mentored)
AwardTrophyJob.perform_later(discussion.student, track, :mentored)
end

def update_roles!
Expand Down
4 changes: 2 additions & 2 deletions test/commands/user_track/acquired_trophy/create_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ class UserTrack::AcquiredTrophy::CreateTest < ActiveSupport::TestCase
Track::Trophies::MentoredTrophy.any_instance.stubs(notification_key:)
User::Notification::Create.expects(:call).with do |actual_user, actual_slug, kwargs|
assert_equal user, actual_user
assert_equal : acquired_trophy, actual_slug
assert_nil kwargs[: user_track_acquired_trophy]
assert_equal :acquired_trophy, actual_slug
refute_nil kwargs[:user_track_acquired_trophy]
end

UserTrack::AcquiredTrophy::Create.(user, track, :mentored)
Expand Down
4 changes: 2 additions & 2 deletions test/serializers/serialize_track_trophies_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class SerializeTrackTrophiesTest < ActiveSupport::TestCase
}
},
{
name: "Completionist",
name: "Exemplary Expert",
criteria: "Awarded once you complete all exercises in Nim",
success_message: "Congratulations on completing all exercises in Nim",
icon_name: "trophy-completed-all-exercises",
Expand Down Expand Up @@ -100,7 +100,7 @@ class SerializeTrackTrophiesTest < ActiveSupport::TestCase
links: {}
},
{
name: "Completionist",
name: "Exemplary Expert",
criteria: "Awarded once you complete all exercises in Prolog",
success_message: "Congratulations on completing all exercises in Prolog",
icon_name: "trophy-completed-all-exercises",
Expand Down
4 changes: 2 additions & 2 deletions test/system/flows/user_views_dashboard_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ class UserViewsDashboardTest < ApplicationSystemTestCase

test "shows latest site updates for joined tracks" do
user = create :user
joined_track = create :track, :random_slug
unjoined_track = create :track, :random_slug
joined_track = create :track, slug: 'ruby'
unjoined_track = create :track, slug: 'kotlin'
create :user_track, user:, track: joined_track
joined_arbitrary_update = create :arbitrary_site_update, title: "Arbitrary update 1",
description_markdown: 'Such a cool update', track: joined_track, published_at: Time.current
Expand Down
4 changes: 2 additions & 2 deletions test/system/pages/tracks/show_joined_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ShowJoinedTest < ApplicationSystemTestCase
end

test "show joined on course-track in different states" do
track = create :track, slug: :ruby_1, title: "Ruby #{SecureRandom.hex}"
track = create :track, slug: "ruby", title: "Ruby #{SecureRandom.hex}"
hello_world = create(:hello_world_exercise, track:)
ce_1 = create :concept_exercise, track:, slug: 'movie'
ce_2 = create :concept_exercise, track:, slug: 'lasa'
Expand Down Expand Up @@ -65,7 +65,7 @@ class ShowJoinedTest < ApplicationSystemTestCase
end

test "show joined on non-course-track in different states" do
track = create :track, slug: :ruby_1, title: "Ruby #{SecureRandom.hex}"
track = create :track, slug: "ruby", title: "Ruby #{SecureRandom.hex}"
hello_world = create(:hello_world_exercise, track:)
pe_1 = create :practice_exercise, track:, slug: 'bob'
create :practice_exercise, track:, slug: 'food'
Expand Down

0 comments on commit 919dc81

Please sign in to comment.