File tree Expand file tree Collapse file tree 3 files changed +11
-5
lines changed
Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,9 @@ class Solution::CompleteTest < ActiveSupport::TestCase
5252 solution = create ( :practice_solution , user :, exercise :)
5353 create ( :iteration , solution :)
5454
55- Solution ::Complete . ( solution , user_track )
55+ perform_enqueued_jobs do
56+ Solution ::Complete . ( solution , user_track )
57+ end
5658
5759 activity = User ::Activities ::CompletedExerciseActivity . last
5860 assert_equal user , activity . user
@@ -73,7 +75,9 @@ class Solution::CompleteTest < ActiveSupport::TestCase
7375 # Sanity check
7476 assert solution . completed?
7577
76- Solution ::Complete . ( solution , user_track )
78+ perform_enqueued_jobs do
79+ Solution ::Complete . ( solution , user_track )
80+ end
7781
7882 solution . reload
7983 assert solution . completed?
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ class Solution::PublishIterationTest < ActiveSupport::TestCase
6868 solution = create ( :concept_solution )
6969 create ( :iteration , submission : create ( :submission , solution :) )
7070
71- Solution ::UpdatePublishedExerciseRepresentation . expects ( :call ) . with ( solution )
71+ Solution ::UpdatePublishedExerciseRepresentation . expects ( :defer ) . with ( solution )
7272
7373 Solution ::Publish . ( solution , user_track , nil )
7474 end
@@ -83,7 +83,7 @@ class Solution::PublishIterationTest < ActiveSupport::TestCase
8383 solution = create ( :concept_solution )
8484 create ( :iteration , submission : create ( :submission , solution :) )
8585
86- Solution ::UpdateTags . expects ( :call ) . with ( solution )
86+ Solution ::UpdateTags . expects ( :defer ) . with ( solution )
8787
8888 Solution ::Publish . ( solution , user_track , nil )
8989 end
Original file line number Diff line number Diff line change @@ -100,7 +100,9 @@ class Solution::PublishTest < ActiveSupport::TestCase
100100 solution = create ( :practice_solution , user :, exercise :)
101101 iteration = create ( :iteration , solution :)
102102
103- Solution ::Publish . ( solution , solution . user_track , iteration . idx )
103+ perform_enqueued_jobs do
104+ Solution ::Publish . ( solution , solution . user_track , iteration . idx )
105+ end
104106
105107 activity = User ::Activities ::PublishedExerciseActivity . last
106108 assert_equal user , activity . user
You can’t perform that action at this time.
0 commit comments