Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe("EventRecommender", function() {
- var EventRecommender = require('../app/EventRecommender');
- var er;
- beforeEach(function() {
- er = new EventRecommender();
- });
- describe("addEvent", function() {
- it("adds a new Event to the system", function() {
- er.addEvent("Change Me");
- expect(er.events.length).toEqual(1);
- expect(er.events[0].title).toEqual("Change Me"); // what are some other things you can test?
- });
- });
- describe("addUser", function() {
- it("adds a new User to the system", function() {
- er.addUser("Change Me");
- expect(er.user.length).toEqual(1);
- });
- });
- describe("saveUserEvent", function() {
- it("adds an event to a user's personal event array", function() {
- er.addEvent("Make a new event");
- er.addUser("Make a new user");
- er.saveUserEvent("event", "user"); // change these to match your method signature
- expect(er.user.personalEvents.length).toEqual(1);
- });
- });
- describe("deleteUser", function() {
- it("removes a User from the system", function() {
- er.addUser("Make a new user here that you will delete later");
- er.deleteUser("Change Me");
- expect(er.user.length).toEqual(0);
- });
- });
- describe("deleteEvent", function() {
- it("removes the event from the system", function() {
- er.addEvent("A new event that you will delete later");
- er.deleteEvent("Change Me");
- expect(er.events.length).toEqual(0);
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement