Rails でテスト時に CSRF チェックはデフォルト無効になるが、有効にしたいときは ActionController::Base.allow_forgery_protection = true で。

progrhymeprogrhyme のブックマーク 2016/05/06 16:34

その他

このブックマークにはスターがありません。
最初のスターをつけてみよう!

How to POST with missing authenticity_token in rspec rails request test?

    I'm simulating a request coming from an external service, which will not have an authenticity token. I want the test to fail if skip_before_action :verify_authenticity_token is missing. How do I do...

    \ コメントが サクサク読める アプリです /

    • App Storeからダウンロード
    • Google Playで手に入れよう