0
我在我的模型範圍,它看起來像:存根通參數範圍
scope :public, -> { another_scope.where(v_id: 1) }
當我存根這種模式在測試:
model.stub(:test).and_return(test)
,所以我收到傳遞一個值,這個範圍
wrong number of arguments (1 for 0)
我該如何避免這種情況? 當我將其更改爲:
scope :public, ->(arg) { another_scope.where(v_id: 1) }
它工作正常,但阿根廷從未使用過
當我不使用拉姆達前也工作得很好:
scope :public, another_scope.where(v_id: 1)