| | |
| | | |
| | | |
| | | // Exercise 3 test case! |
| | | it("should ....", function(done) { |
| | | it("should mark todo as important and persist it", function(done) { |
| | | request(app) |
| | | .put("/api/todos/" + todoId) |
| | | .send({ title: "LOVE endpoint/server side testing!", completed: true }) |
| | | .send({ title: "LOVE endpoint/server side testing!", completed: true, important: true }) |
| | | .expect(200) |
| | | .expect("Content-Type", /json/) |
| | | .end(function(err, res) { |
| | |
| | | res.body.should.have.property("_id"); |
| | | res.body.title.should.equal("LOVE endpoint/server side testing!"); |
| | | // YOUR TEST GO HERE |
| | | |
| | | res.body.important.should.equal(true); |
| | | done(); |
| | | }); |
| | | }); |