0
在我的規範中,當我在下面運行POST請求時,一切正常。在RSpec中爲PUT接收錯誤,但不是POST
before do
request_payload = {
player: {
first_name: "Joe",
last_name: "Carradine",
team_id: "1"
}
}
post :create, request_payload
end
但是當我運行了把規格:
before do
request_payload = {
player: {
first_name: "Buck",
last_name: "Carradine",
team_id: "1"
}
}
put :update, id: 3, request_payload
end
我得到這樣一個錯誤:
[filename]_spec.rb:139: syntax error, unexpected '\n', expecting tASSOC (SyntaxError)
[filename]_spec.rb:198: syntax error, unexpected $end, expecting keyword_end
任何想法?有沒有不同的PUT語法我不知道?