Sha256: 03fdb3395cf33e3c1d7818c7108453f5ee6d470ffdff596e88f80ab2896ca494

Contents?: true

Size: 1.45 KB

Versions: 6

Compression:

Stored size: 1.45 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

6 entries across 6 versions & 1 rubygems

Version Path
cacheable_flash-1.0.0 spec/js_unit/cookie_test.html
cacheable_flash-0.3.4 spec/js_unit/cookie_test.html
cacheable_flash-0.3.3 spec/js_unit/cookie_test.html
cacheable_flash-0.2.2 spec/js_unit/cookie_test.html
cacheable_flash-0.2.1 spec/js_unit/cookie_test.html
cacheable_flash-0.2.0 spec/js_unit/cookie_test.html