From b510a7b65f5ed7c9464e114c09d81fa6d03bd1c7 Mon Sep 17 00:00:00 2001 From: manu vasconcelos Date: Mon, 16 Sep 2024 15:50:47 -0300 Subject: [PATCH] change assert_nothing_raised to assert_difference this way we make sure the team was created, the background job did what it was supposed to. --- test/workers/generic_worker_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/workers/generic_worker_test.rb b/test/workers/generic_worker_test.rb index 3ea8b0f38..f5972ec9d 100644 --- a/test/workers/generic_worker_test.rb +++ b/test/workers/generic_worker_test.rb @@ -12,7 +12,7 @@ def teardown test "should run a job, without raising an error, for a method that takes a hash as a parameter" do Sidekiq::Testing.inline! - assert_nothing_raised do + assert_difference "Team.where(name: 'BackgroundTeam', slug: 'background-team').count" do GenericWorker.perform_async('Team', 'create!', name: 'BackgroundTeam', slug: 'background-team') end end