Skip to content

Commit

Permalink
finished the tests!!!!
Browse files Browse the repository at this point in the history
  • Loading branch information
kmharr10 committed May 7, 2014
1 parent ff4ad2e commit d79c45f
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 35 deletions.
57 changes: 57 additions & 0 deletions Tests/System/addevent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// Tests for use cases at the notes route
var notes = require('../../models/notes');
var zombie = require('zombie');
var browser = new zombie();

// Empty the database
exports['setup'] = function(test) {
notes.deleteAll(function() {
test.done();
});
};


exports['log in (success)'] = function(test) {
test.expect(2);
console.log('hello');
browser.visit('http://localhost:8082/', function() {
test.ok(browser.query('#login'));
console.log('hey');
browser.
fill('#login_name', 'Kayla').
fill('#login_password', 'hello').
pressButton('#login_submit', function() {
test.ok(browser.query('#logout'));
console.log('whats up?');

test.done();
});
});
}

exports['make an event'] = function(test) {
test.expect(2);

browser.visit('http://localhost:8082/addEvent', function() {
test.ok(browser.query('#addEvent'));

browser.
fill('#name', 'class').
fill('#date', '05/17/2014').
fill('#time', '1000').
fill('#location', 'dana').
pressButton('#event_add', function() {
test.ok(browser.query('#logout'));
test.done();
});
});
}

// Empty the database and close the connection
exports['cleanup'] = function(test) {
notes.deleteAll(function() {
notes.close(function() {
test.done();
});
});
};
65 changes: 33 additions & 32 deletions Tests/System/addnote.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
// Tests for use cases at the notes route
var notes = require('../../models/notes');
var users = require('../../models/users');
var zombie = require('zombie');
var browser = new zombie();

// Empty the database
exports['setup'] = function(test) {
notes.deleteAll(function() {
test.done();
});
// Tests for use cases at the notes route
var notes = require('../../models/notes');
var zombie = require('zombie');
var browser = new zombie();

// Empty the database
exports['setup'] = function(test) {
notes.deleteAll(function() {
test.done();
});
};

exports['log in (success)'] = function(test) {
test.expect(2);
console.log('hello');
browser.visit('http://localhost:8082/', function() {
test.ok(browser.query('#login'));
console.log('hey');
browser.
fill('#login_name', 'Kayla').
fill('#login_password', 'hello').
pressButton('#login_submit', function() {
test.expect(2);
console.log('hello');
browser.visit('http://localhost:8082/', function() {
test.ok(browser.query('#login'));
console.log('hey');
browser.
fill('#login_name', 'Kayla').
fill('#login_password', 'hello').
pressButton('#login_submit', function() {
test.ok(browser.query('#logout'));
console.log('whats up?');

test.done();
});
});

test.done();
});
});
}

exports['make an account (success)'] = function(test) {
exports['make a note'] = function(test) {
test.expect(2);

browser.visit('http://localhost:8082/addNote', function() {
Expand All @@ -45,12 +44,14 @@ exports['make an account (success)'] = function(test) {
});
}




// Empty the database and close the connection
exports['cleanup'] = function(test) {
notes.deleteAll(function() {
notes.close(function() {
test.done();
});
});
// Empty the database and close the connection
exports['cleanup'] = function(test) {
notes.deleteAll(function() {
notes.close(function() {
test.done();
});
});
};
4 changes: 2 additions & 2 deletions views/addEvent.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<% include chunks/StuInfo %>

<div>
<form method="post" action="/addingEvent">
<form id="addEvent" method="post" action="/addingEvent">
<fieldset>
<input type="text" name="name" id="name" placeholder="Event name">
<input type="date" name="date" id="date" >
<input type="text" name="time" id="time" placeholder="Event stime">
<input type="text" name="location" id="location" placeholder="Event location">
<input type="submit" value="Add">
<input id = "event_add" type="submit" value="Add">
</fieldset>
</form>
</div>
Expand Down
2 changes: 1 addition & 1 deletion views/chunks/calendar_menu.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<button type="button"class ="calendarHeading" id="create_event">
<span class="glyphicon glyphicon-star"></span>
<a href="/addEcent">Create Event</a>
<a href="/addEvent">Create Event</a>
</button>

<h2 class ="calendarHeading" id="month"><%=calendarMonth %></h1>
Expand Down

0 comments on commit d79c45f

Please sign in to comment.