Mock Model Issue

I am having difficulty with a mocking a model in rspec

Here’s the code:

let (:example) {mock_model(“Example”, id: “37”, another_id: “59”}

The actual controller does the following:

examples.select(:another_id)

Rspec complains about this line. It says there are wrong number of
arguments (1 for 0). Stacktrace complains about the select statement.

I’ve tried stubbing the select method.

examples = [example]
allow(examples).to receive(:select).with(:another_id)

but this doesn’t work.

I went into the controller with byebug and examples.select still
complains that it has the wronge number of args.

Any ideas?