没有将 Symbol 隐式转换为 String?在 rails 应用中 在 rspec 测试用例中
no implicit conversion of Symbol into String? in rails application in rspec testcase
#typhoeus running the request
Typhoeus::Request.new("#{BASE_URI}",
method: :post,
body: lead,
headers: { Accept: "application/json" },
verbose: true,
ssl_verifypeer: false).run
当我删除 headers 行然后调用 Http 请求时 运行 请求的测试用例 运行 时,斑疹伤寒抛出上述错误
Typhoeus::Request.new("#{BASE_URI}",
{
method: :post,
body: lead,
headers: { Accept: "application/json" },
verbose: true,
ssl_verifypeer: false
}).run
问题是 (Accept: "application/json") 而我改为 ('Accept' => "application/json") 效果很好。
#typhoeus running the request
Typhoeus::Request.new("#{BASE_URI}",
method: :post,
body: lead,
headers: { Accept: "application/json" },
verbose: true,
ssl_verifypeer: false).run
当我删除 headers 行然后调用 Http 请求时 运行 请求的测试用例 运行 时,斑疹伤寒抛出上述错误
Typhoeus::Request.new("#{BASE_URI}",
{
method: :post,
body: lead,
headers: { Accept: "application/json" },
verbose: true,
ssl_verifypeer: false
}).run
问题是 (Accept: "application/json") 而我改为 ('Accept' => "application/json") 效果很好。