describe('url helper', function() {
  it("url helper", function() {
    var href = Handlebars.helpers.url.call({}, '/a/{{b}}', {'expand-tokens': true});
    expect(href).to.equal('#/a/');
    href = Handlebars.helpers.url.call({b: 'b'}, '/a/{{b}}', {'expand-tokens': true});
    expect(href).to.equal('#/a/b');
    href = Handlebars.helpers.url.call({b: 'c'}, '/a/{{b}}', {'expand-tokens': true});
    expect(href).to.equal('#/a/c');

    href = Handlebars.helpers.url('a', 'c', {});
    expect(href).to.equal('#a/c');
  });
});

@@ -517,13 +517,793 @@
 );%0A  %7D);
+%0A%0A  describe('urls are properly encoded', function () %7B%0A    it('when joining multiple arguments automatically', function () %7B%0A      // uses encodeURIComponent in /src/helpers/url.js%0A      var slug = %22hello world, sup!%22,%0A          actual = Handlebars.helpers.url('articles', slug, %7B%7D),%0A          expected = '#articles/hello%2520world%252C%2520sup!';%0A%0A      expect(actual).to.eq(expected);%0A    %7D);%0A    it('when using expand-tokens=true (bug)', function () %7B%0A      // uses Thorax.Util.expandToken from /src/util.js, line 260%0A      var context = %7Bslug: %22hello world, sup!%22%7D,%0A          actual = Handlebars.helpers.url.call(context, '/articles/%7B%7Bslug%7D%7D', %7B'expand-tokens': true%7D),%0A          expected = '#/articles/hello%2520world%252C%2520sup!';%0A%0A      expect(actual).to.eq(expected);%0A    %7D);%0A  %7D);
 %0A%7D);%0A

encode output of url helper when using expands-tokens=true