【发布时间】:2015-05-10 22:02:17
【问题描述】:
我正在模拟来自外部服务的请求,该服务没有真实性令牌。如果skip_before_action :verify_authenticity_token 丢失,我希望测试失败。
如何根据 Rspec 请求规范执行此操作?
目前我正在使用post,如下所示,但很高兴接受。
post endpoint, my_json_string, {'CONTENT_TYPE' => "application/json"}
【问题讨论】:
标签: ruby-on-rails rspec csrf authenticity-token