“Can't verify CSRF token authenticity” when testing emberjs/rails/devise app using qunit
问题 I have a emberjs/rails application using devise for user authentication. I am building integration tests using qunit. I manually log into the app before I run tests. GET requests can be processed during tests, but POST requests fail. In particular, when making a POST request, I'm getting a "Can't verify CSRF token authenticity" error from devise. When I reload tests, I am logged out of app. How do I get qunit to play nice with devise? 回答1: You need to add csrf_meta_tags to the index.html.erb