I'm trying to stub:
Thing.where(uuid: options['uuid']).first
Via:
allow(Thing).to receive_message_chain(:where, :first)
.with(uuid: thing_double.uuid)
.and_return(nil)
But this is returning:
#<Double (anonymous)> received :first with unexpected arguments
expected: ({:uuid=>123})
got: (no args)
Is there a different way I should be validating arguments for message chains?
allow(Thing).to receive_message_chain(:where).first
?