Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/helpers/Path.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ var Path = {
var paramName = getParamName(pathSegment);

invariant(
params[paramName],
params[paramName] != null,
'Missing "' + paramName + '" parameter for path "' + pattern + '"'
);

Expand Down
4 changes: 4 additions & 0 deletions specs/Path.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ describe('Path.injectParams', function () {
it('returns the correct path', function () {
expect(Path.injectParams(pattern, { id: 'abc' })).toEqual('comments/abc/edit');
});

it('returns the correct path when the value is 0', function () {
expect(Path.injectParams(pattern, { id: 0 })).toEqual('comments/0/edit');
});
});

describe('and some params have special URL encoding', function () {
Expand Down