@@ -62,7 +62,7 @@ class ResetParticipationsJobTest < ActiveJob::TestCase
6262 with_memory_cache do
6363 Telegram ::Chat ::Session . start ( player . telegram_chat_id . to_s , game )
6464
65- stub_singleton ( SendTelegramNotificationJob , :perform_later , -> ( chat_id , text ) { sent << [ chat_id , text ] } ) do
65+ stub_singleton ( SendTelegramNotificationJob , :perform_later , -> ( chat_id , text , ** opts ) { sent << [ chat_id , text , opts ] } ) do
6666 ResetParticipationsJob . perform_now
6767 end
6868
@@ -71,8 +71,9 @@ class ResetParticipationsJobTest < ActiveJob::TestCase
7171 end
7272
7373 assert_equal [ player . telegram_chat_id . to_s ] , sent . map ( &:first )
74- assert_match "закрыт" , sent . first . last
75- assert_no_match ( /translation missing/i , sent . first . last )
74+ assert_match "закрыт" , sent . first [ 1 ]
75+ assert_no_match ( /translation missing/i , sent . first [ 1 ] )
76+ assert_equal ( { silent : true } , sent . first [ 2 ] , "письмо о закрытии чата приходит без звука" )
7677 end
7778
7879 # Организатор из состава не выпадает — ему закрывать нечего.
@@ -84,7 +85,7 @@ class ResetParticipationsJobTest < ActiveJob::TestCase
8485
8586 sent = [ ]
8687 with_memory_cache do
87- stub_singleton ( SendTelegramNotificationJob , :perform_later , -> ( chat_id , text ) { sent << [ chat_id , text ] } ) do
88+ stub_singleton ( SendTelegramNotificationJob , :perform_later , -> ( chat_id , text , ** opts ) { sent << [ chat_id , text , opts ] } ) do
8889 ResetParticipationsJob . perform_now
8990 end
9091 end
0 commit comments