Skip to content

Commit

Permalink
Add unit test for encoded # in query params
Browse files Browse the repository at this point in the history
  • Loading branch information
brianjmiller committed Mar 3, 2015
1 parent ee1c12e commit e779bb1
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/js/unit/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,27 @@
},
"return value: with odd params, https no port, and hash"
);

result = TinCan.Utils.parseURL("http://tincanapi.com:8080/TinCanJS/Test/TinCan.Utils_parseURL/test?paramA=1&paramB=2&paramC=%23isahashsymbol#theRealHash");
deepEqual(
result,
{
protocol: "http:",
host: "tincanapi.com:8080",
hostname: "tincanapi.com",
port: "8080",
pathname: "/TinCanJS/Test/TinCan.Utils_parseURL/test",
search: "?paramA=1&paramB=2&paramC=%23isahashsymbol",
hash: "#theRealHash",
params: {
paramA: "1",
paramB: "2",
paramC: "#isahashsymbol"
},
path: "http://tincanapi.com:8080/TinCanJS/Test/TinCan.Utils_parseURL/test"
},
"return value: with params"
);
}
);
test(
Expand Down

0 comments on commit e779bb1

Please sign in to comment.