📜  NameError: undefined local variable or method `json&#39; for # <RSpec::ExampleGroups::Categories::POSTCategory::WhenTheRequestIsValid "creates a category" (. spec requests categories_spec.rb:27)>你的意思是? JSON - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:59.085000             🧑  作者: Mango

代码示例1
expect(response).to have_http_status(:success)
expect {
    JSON.parse(response.body)
}.to_not raise_error