(function() { module('csrf-refresh', {}) asyncTest('refresh all csrf tokens', 1, function() { var correctToken = 'cf50faa3fe97702ca1ae' var form = $('
') var input = $('').attr({ type: 'hidden', name: 'authenticity_token', id: 'authenticity_token', value: 'foo' }) input.appendTo(form) $('#qunit-fixture') .append('') .append('') .append(form) $.rails.refreshCSRFTokens() currentToken = $('#qunit-fixture #authenticity_token').val() start() equal(currentToken, correctToken) }) })()