Fix RSpec deprecation warnings

[#50752269]

Replace deprecated mock with double.