Sha256: 1625e7b06983624381131b7e128acfe306208a19428834d69ee42e58baaff56c

Contents?: true

Size: 1.51 KB

Versions: 10

Compression:

Stored size: 1.51 KB

Contents

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <!-- You will need to change this to point to your jsUnitCore.js -->
  <script src="http://localhost:3000/jsunit/app/jsUnitCore.js" type="text/javascript"></script>

  <script src="../../javascripts/jquery.js" type="text/javascript"></script>
  <script src="../../javascripts/cookie.js" type="text/javascript"></script>

  <script language="javascript" type="text/javascript">
  var content;
  function setUp() {
    content = $('#content');
    Cookie.eraseAll();
  }

  function tearDown() {
    Cookie.eraseAll();
  }

  function test_read() {
    var expires = new Date();
    expires.setYear(expires.getFullYear() + 1);
    document.cookie = "foobar=baz; path=/; expires=" + expires.toGMTString();

    assertEquals('baz', Cookie.get('foobar'));
  }

  function test_write() {
    Cookie.set('foobar', 'baz');
    assertEquals("baz", Cookie.get('foobar'));
  }

  function test_expire() {
    Cookie.set('foobar', 'baz');
    Cookie.erase('foobar');
    assertNull(Cookie.get('foobar'));
  }

  function test_expireAll() {
    Cookie.set('foobar', 'baz');
    Cookie.set('another', 'cookie');

    Cookie.eraseAll();

    assertNull(Cookie.get('foobar'));
    assertNull(Cookie.get('another'));
  }

  </script>

</head>

<body>
  <div id="fixture">
    <div id="content"></div>
  </div>
</body>
</html>

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
cacheable_flash-0.3.2 spec/js_unit/cookie_test.html
cacheable_flash-0.3.1 spec/js_unit/cookie_test.html
cacheable_flash-0.3.0 spec/js_unit/cookie_test.html
cacheable_flash-0.2.10 spec/js_unit/cookie_test.html
cacheable_flash-0.2.9 spec/js_unit/cookie_test.html
cacheable_flash-0.2.8 spec/js_unit/cookie_test.html
cacheable_flash-0.2.7 spec/js_unit/cookie_test.html
cacheable_flash-0.2.5 spec/js_unit/cookie_test.html
cacheable_flash-0.2.4 spec/js_unit/cookie_test.html
cacheable_flash-0.2.3 spec/js_unit/cookie_test.html