Skip to content

Commit

Permalink
test(urlMatcher): Add failing test for angular-ui#2504 improper paren…
Browse files Browse the repository at this point in the history
…t/child query params formatting
  • Loading branch information
christopherthielen committed Jan 31, 2016
1 parent 94bcbbe commit 7792134
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/urlMatcherFactorySpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,19 @@ describe("UrlMatcher", function () {

expect(m.format(params)).toEqual('/users');
});

it("should format query parameters from parent, child, grandchild matchers", function() {
var m = new UrlMatcher('/parent?qParent');
var m2 = m.append(new UrlMatcher('/child?qChild'));
var m3 = m2.append(new UrlMatcher('/grandchild?qGrandchild'));

var params = { qParent: 'parent', qChild: 'child', qGrandchild: 'grandchild' };
var url = '/parent/child/grandchild?qParent=parent&qChild=child&qGrandchild=grandchild';

var formatted = m3.format(params);
expect(formatted).toBe(url);
expect(m3.exec(url.split('?')[0], params)).toEqualData(params);
})
});

describe(".append()", function() {
Expand Down

0 comments on commit 7792134

Please sign in to comment.