Sha256: 498bd5c8023ad268bbceb25e1f8cb6e114c77ffbd7f39a857dde1c4616421dce
Contents?: true
Size: 1.38 KB
Versions: 11
Compression:
Stored size: 1.38 KB
Contents
u = up.util $ = jQuery describe 'up.protocol', -> describe 'up.protocol.csrfToken', -> afterEach -> @$meta?.remove() it 'returns the [content] of a <meta name="csrf-token"> by default', -> @$meta = $('<meta name="csrf-token" content="token-from-meta">').appendTo('head') expect(up.protocol.csrfToken()).toEqual('token-from-meta') it 'returns a configured token', -> up.protocol.config.csrfToken = 'configured-token' expect(up.protocol.csrfToken()).toEqual('configured-token') it 'allows to configure a function that returns the token', -> up.protocol.config.csrfToken = -> 'configured-token' expect(up.protocol.csrfToken()).toEqual('configured-token') describe 'up.protocol.csrfParam()', -> afterEach -> @$meta?.remove() it 'returns the [content] of a <meta name="csrf-param"> by default', -> @$meta = $('<meta name="csrf-param" content="param-from-meta">').appendTo('head') expect(up.protocol.csrfParam()).toEqual('param-from-meta') it 'returns a configured parameter name', -> up.protocol.config.csrfParam = 'configured-param' expect(up.protocol.csrfParam()).toEqual('configured-param') it 'allows to configure a function that returns the parameter name', -> up.protocol.config.csrfParam = -> 'configured-param' expect(up.protocol.csrfParam()).toEqual('configured-param')
Version data entries
11 entries across 11 versions & 1 rubygems