@@ -1,7 +1,6 @@
|
|||||||
describe("QueryString", function() {
|
describe("QueryString", function() {
|
||||||
|
|
||||||
describe("#setParam", function() {
|
describe("#setParam", function() {
|
||||||
|
|
||||||
it("sets the query string to include the given key/value pair", function() {
|
it("sets the query string to include the given key/value pair", function() {
|
||||||
var windowLocation = {
|
var windowLocation = {
|
||||||
search: ""
|
search: ""
|
||||||
@@ -14,6 +13,20 @@ describe("QueryString", function() {
|
|||||||
|
|
||||||
expect(windowLocation.search).toMatch(/foo=bar%20baz/);
|
expect(windowLocation.search).toMatch(/foo=bar%20baz/);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("leaves existing params alone", function() {
|
||||||
|
var windowLocation = {
|
||||||
|
search: "?foo=bar"
|
||||||
|
},
|
||||||
|
queryString = new j$.QueryString({
|
||||||
|
getWindowLocation: function() { return windowLocation }
|
||||||
|
});
|
||||||
|
|
||||||
|
queryString.setParam("baz", "quux");
|
||||||
|
|
||||||
|
expect(windowLocation.search).toMatch(/foo=bar/);
|
||||||
|
expect(windowLocation.search).toMatch(/baz=quux/);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("#getParam", function() {
|
describe("#getParam", function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user