mithril-vndb/test/mithril.route.buildQueryString.js
Isiah Meadows 9fab2b8371 Create CONTRIBUTING.md
I added the following to it:

- Bug reporting
- Feature requests
- Contributing guide
- Style guide
2015-11-10 03:22:39 -05:00

26 lines
613 B
JavaScript

describe("m.route.buildQueryString()", function () {
"use strict"
it("exists", function () {
expect(m.route.buildQueryString).to.be.a("function")
})
it("converts an empty object to an empty string", function () {
expect(m.route.buildQueryString({})).to.equal("")
})
it("converts an object into a correct query string", function () {
expect(
m.route.buildQueryString({
foo: "bar",
hello: ["world", "mars", "mars"],
world: {
test: 3,
},
bam: "",
yup: null,
removed: undefined,
})
).to.equal("foo=bar&hello=world&hello=mars&world%5Btest%5D=3&bam=&yup")
})
})