Skip to content

Commit 772b458

Browse files
committed
chore(urlMatcher): adding tests to validate hash URL templates
Refs #510
1 parent b18d807 commit 772b458

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/urlMatcherFactorySpec.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,13 @@ describe("UrlMatcher", function () {
9797
expect(new UrlMatcher('/users/:id').format({ id:'100%'})).toEqual('/users/100%25');
9898
});
9999

100+
it(".format() encodes URL parameters with hashes", function () {
101+
expect(
102+
new UrlMatcher('/users/:id#:section')
103+
.format({ id: 'bob', section: 'contact-details' }))
104+
.toEqual('/users/bob#contact-details');
105+
});
106+
100107
it(".concat() concatenates matchers", function () {
101108
var matcher = new UrlMatcher('/users/:id/details/{type}?from').concat('/{repeat:[0-9]+}?to');
102109
var params = matcher.parameters();

0 commit comments

Comments
 (0)