I want to call a named_scope that will only return one record, but the named_scope returns an array, that\'s not a big deal as I can just chain it with .first:
M
Better version of
Client.stub!(:named_scope).and_return(@clients = mock([Client])) @clients.stub!(:first).and_return(@client = mock(Client))
will be:
Client.should_receive(:named_scope).with(param).and_return do record = mock_model(Comm) record.should_receive(:do_something_else) [record] end