Skip to content

Commit a71f2fa

Browse files
committed
10.1 query string
1 parent 5371d9f commit a71f2fa

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

‎test/server.test.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,17 @@ describe("server", () => {
129129
assert.equal(response.body.echo, randomWord);
130130
});
131131
});
132+
// 10.1
133+
it('should return `{ name: "FIRSTNAME LASTNAME" }` from GET requests to "/name?first=FIRSTNAME&last=LASTNAME"', () => {
134+
return request(server)
135+
.get("/name?first=FIRSTNAME&last=LASTNAME")
136+
.expect("Content-type", /application\/json/)
137+
.expect(200)
138+
.then(response => {
139+
assert.ok(response.body, "Body does not contain json");
140+
assert.equal(response.body.name, "FIRSTNAME LASTNAME");
141+
});
142+
});
132143
after(() => {
133144
server.close();
134145
});

0 commit comments

Comments
 (0)