它工作正常:Rspec的意外keyword_end,期待 '}'
post :create, params_with_product
,它太:
put :update, id:@item, item: params_with_product
但它失败,语法错误语法错误,unexpected keyword_end, expecting '}'
当我这样做:
put :update, :id => @item.id, params_with_product
其中:
let(params_with_product) { item: FactoryGirl.attributes_for(:item_without_product) }
这是正确的。 –