"code": 500, "message": "Unexpected error", "status": "INTERNAL", "details": [ { "@type": "type.googleapis.com/google.firebas e.fcm.v1.FcmError", "errorCode": "INTERNAL" } ] } } 500 Response Rspec Test context '異常系 ' do context 'エラーコードが INTERNAL' do let(:device_tokens) { %w(dummy_token4) } before do allow(fcm_messenger).to receive(:send_one).and_call_original end it '10秒間sleepしてからリトライする ' do res = subject[:results] expect(fcm_messenger).to have_received(:sleep).with(10).once expect(fcm_messenger).to have_received(:send_one).exactly(device_tokens.size * 2).times end end