我正在模拟来自外部服务的请求,该服务不具有真实性令牌.如果skip_before_action :verify_authenticity_token丢失,我希望测试失败.
skip_before_action :verify_authenticity_token
我如何从Rspec请求规范中执行此操作?
目前我正在使用post如下,但它很高兴被接受.
post
post endpoint, my_json_string, {'CONTENT_TYPE' => "application/json"}
rspec ruby-on-rails csrf authenticity-token
authenticity-token ×1
csrf ×1
rspec ×1
ruby-on-rails ×1