0
这个测试的等效cURL请求是什么?等效卷曲请求
test "create user" do
user = {
user: {
username: "fasfas",
password: "fasfas",
password_confirmation: "fasfas",
email: "[email protected]"
}
}
post "/users", user, {"Accept" => "application/json"}
assert_equal response.status, 201
end
我试图像
curl http://someurl.com/users -d "username=...&password=..."
等,但由于控制器需要user
PARAM它不工作。
它的工作!顺便说一句,我读了其他问题,如果你使用'-d'选项,你不需要指定POST方法。无论如何,感谢fella! – tehAnswer