if you stub t as:
helper.stub(:t).with('.product_discount', discount_percentage: product.discount_percentage) { "This product has #{product.discount_percentage}% discount." }
you can test with:
expect(helper.render_product_discount).to eq("This product has #{product.discount_percentage}% discount.")
Edit
As SebastianG answered, you can set @virtual_path
with the expected path to use like in the main code, what I think it´s a better approach when possible.