0
我有以下代碼:如何存根:Rspec中的哪個方法?
Group.where('name ~* ?', params[:name]).first
如何存根在這種情況下where
方法?
Group.stub(:where).and_return(mock_model(Group, name: "SomeName"))
導致錯誤:
Mock "Group_1001" received unexpected message :first with (no args)