From 32b38bda08d69aa0c9869b20d0cc46583e44dcb4 Mon Sep 17 00:00:00 2001 From: Leah Date: Tue, 14 Jun 2016 14:37:17 -0700 Subject: [PATCH 01/69] added js files for rentals, customers, movies routes --- routes/customers.js | 9 +++++++++ routes/movies.js | 9 +++++++++ routes/rentals.js | 9 +++++++++ 3 files changed, 27 insertions(+) create mode 100644 routes/customers.js create mode 100644 routes/movies.js create mode 100644 routes/rentals.js diff --git a/routes/customers.js b/routes/customers.js new file mode 100644 index 000000000..92bffcce9 --- /dev/null +++ b/routes/customers.js @@ -0,0 +1,9 @@ +var express = require('express'); +var router = express.Router(); + +/* GET home page. */ +// router.get('/', function(req, res, next) { +// res.status(200).json({whatevs: 'whatevs!!!'}) +// }); + +module.exports = router; diff --git a/routes/movies.js b/routes/movies.js new file mode 100644 index 000000000..06cfc1137 --- /dev/null +++ b/routes/movies.js @@ -0,0 +1,9 @@ +var express = require('express'); +var router = express.Router(); + +/* GET home page. */ +router.get('/', function(req, res, next) { + res.status(200).json({whatevs: 'whatevs!!!'}) +}); + +module.exports = router; diff --git a/routes/rentals.js b/routes/rentals.js new file mode 100644 index 000000000..92bffcce9 --- /dev/null +++ b/routes/rentals.js @@ -0,0 +1,9 @@ +var express = require('express'); +var router = express.Router(); + +/* GET home page. */ +// router.get('/', function(req, res, next) { +// res.status(200).json({whatevs: 'whatevs!!!'}) +// }); + +module.exports = router; From c58a53fab9a4ad2721b7d7136bba4c5c5a381f3b Mon Sep 17 00:00:00 2001 From: Leah Date: Tue, 14 Jun 2016 14:43:59 -0700 Subject: [PATCH 02/69] create index route to server it works json data --- routes/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/routes/index.js b/routes/index.js index 06cfc1137..f8e421cee 100644 --- a/routes/index.js +++ b/routes/index.js @@ -1,9 +1,14 @@ var express = require('express'); var router = express.Router(); +// var Controller = require('../controllers/scrabble') /* GET home page. */ router.get('/', function(req, res, next) { - res.status(200).json({whatevs: 'whatevs!!!'}) + res.status(200).json({index: 'index'}) +}); + +router.get('/zomg', function(req, res, next) { + res.status(200).json({whatevs: 'it works!!!!'}) }); module.exports = router; From 1e79dd14a289d4f3f3f2af4ad7f4455abdc939d0 Mon Sep 17 00:00:00 2001 From: Leah Date: Tue, 14 Jun 2016 14:45:59 -0700 Subject: [PATCH 03/69] added empty controllers --- controllers/customers.js | 0 controllers/movies.js | 0 controllers/rentals.js | 0 tasks/load_schema.js | 0 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 controllers/customers.js create mode 100644 controllers/movies.js create mode 100644 controllers/rentals.js create mode 100644 tasks/load_schema.js diff --git a/controllers/customers.js b/controllers/customers.js new file mode 100644 index 000000000..e69de29bb diff --git a/controllers/movies.js b/controllers/movies.js new file mode 100644 index 000000000..e69de29bb diff --git a/controllers/rentals.js b/controllers/rentals.js new file mode 100644 index 000000000..e69de29bb diff --git a/tasks/load_schema.js b/tasks/load_schema.js new file mode 100644 index 000000000..e69de29bb From 1146f58fc8b0c606e898b47612ef75fd88648336 Mon Sep 17 00:00:00 2001 From: Leah Date: Tue, 14 Jun 2016 14:46:50 -0700 Subject: [PATCH 04/69] added db dirs and files --- db/setup/schema.sql | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 db/setup/schema.sql diff --git a/db/setup/schema.sql b/db/setup/schema.sql new file mode 100644 index 000000000..e69de29bb From 05a8c0fbe1d0a6af7f160b383f3742f0dd99c425 Mon Sep 17 00:00:00 2001 From: Leah Date: Tue, 14 Jun 2016 14:51:25 -0700 Subject: [PATCH 05/69] added controller scaffolding --- controllers/customers.js | 7 +++++++ controllers/movies.js | 7 +++++++ controllers/rentals.js | 7 +++++++ routes/customers.js | 6 ++++++ routes/movies.js | 1 + routes/rentals.js | 1 + 6 files changed, 29 insertions(+) diff --git a/controllers/customers.js b/controllers/customers.js index e69de29bb..6c2f23435 100644 --- a/controllers/customers.js +++ b/controllers/customers.js @@ -0,0 +1,7 @@ +CustomersController = { + getCustomers: function(req, res) { + + } +} + +module.exports = CustomersController \ No newline at end of file diff --git a/controllers/movies.js b/controllers/movies.js index e69de29bb..e6666a16a 100644 --- a/controllers/movies.js +++ b/controllers/movies.js @@ -0,0 +1,7 @@ +MoviesController = { + getMovies: function(req, res) { + + } +} + +module.exports = MoviesController \ No newline at end of file diff --git a/controllers/rentals.js b/controllers/rentals.js index e69de29bb..cf8cfe163 100644 --- a/controllers/rentals.js +++ b/controllers/rentals.js @@ -0,0 +1,7 @@ +RentalsController = { + // getRentals: function(req, res) { + + // } +} + +module.exports = RentalsController \ No newline at end of file diff --git a/routes/customers.js b/routes/customers.js index 92bffcce9..61b162c69 100644 --- a/routes/customers.js +++ b/routes/customers.js @@ -1,9 +1,15 @@ var express = require('express'); var router = express.Router(); +var Controller = require('../controllers/customers') + + /* GET home page. */ // router.get('/', function(req, res, next) { // res.status(200).json({whatevs: 'whatevs!!!'}) // }); + +router.get('/customers', Controller.getCustomers) + module.exports = router; diff --git a/routes/movies.js b/routes/movies.js index 06cfc1137..64b0deee4 100644 --- a/routes/movies.js +++ b/routes/movies.js @@ -1,5 +1,6 @@ var express = require('express'); var router = express.Router(); +var Controller = require('../controllers/movies') /* GET home page. */ router.get('/', function(req, res, next) { diff --git a/routes/rentals.js b/routes/rentals.js index 92bffcce9..3828aee96 100644 --- a/routes/rentals.js +++ b/routes/rentals.js @@ -1,5 +1,6 @@ var express = require('express'); var router = express.Router(); +var Controller = require('../controllers/rentals') /* GET home page. */ // router.get('/', function(req, res, next) { From 2fed9bb31be5967a774ed0ce8821bf7dafc824e0 Mon Sep 17 00:00:00 2001 From: Leah Date: Tue, 14 Jun 2016 14:57:40 -0700 Subject: [PATCH 06/69] added routes to costumes and placeholder methods --- controllers/customers.js | 12 ++++++++++++ controllers/movies.js | 4 ++++ routes/customers.js | 5 +++++ routes/movies.js | 7 +++---- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/controllers/customers.js b/controllers/customers.js index 6c2f23435..16e14c9fe 100644 --- a/controllers/customers.js +++ b/controllers/customers.js @@ -1,6 +1,18 @@ CustomersController = { getCustomers: function(req, res) { + }, + + subsetCustomers: function(req, res) { + + }, + + getCustomersCurrent: function(req, res) { + + }, + + getCustomersHistory: function(req, res) { + } } diff --git a/controllers/movies.js b/controllers/movies.js index e6666a16a..f23e82eef 100644 --- a/controllers/movies.js +++ b/controllers/movies.js @@ -1,6 +1,10 @@ MoviesController = { getMovies: function(req, res) { + }, + + subsetMovies: function(req, res) { + } } diff --git a/routes/customers.js b/routes/customers.js index 61b162c69..1db8edf4f 100644 --- a/routes/customers.js +++ b/routes/customers.js @@ -11,5 +11,10 @@ var Controller = require('../controllers/customers') router.get('/customers', Controller.getCustomers) +// wtf - see instructions????? +router.get('/customers/sort/name?n=10&p=2', Controller.subsetCustomers) +router.get('/customers/:id/current', Controller.getCustomersCurrent) +router.get('/customers/:id/history', Controller.getCustomersHistory) + module.exports = router; diff --git a/routes/movies.js b/routes/movies.js index 64b0deee4..896e64e66 100644 --- a/routes/movies.js +++ b/routes/movies.js @@ -2,9 +2,8 @@ var express = require('express'); var router = express.Router(); var Controller = require('../controllers/movies') -/* GET home page. */ -router.get('/', function(req, res, next) { - res.status(200).json({whatevs: 'whatevs!!!'}) -}); + +router.get('/movies', Controller.getMovies) +router.get('/movies/sort/name?n=10&p=2', Controller.subsetMovies) module.exports = router; From 923bffa37fe631d7f63acc0fe2397d724a6fe4b6 Mon Sep 17 00:00:00 2001 From: Leah Date: Tue, 14 Jun 2016 15:00:29 -0700 Subject: [PATCH 07/69] added routes to movies and placeholder methods --- controllers/movies.js | 10 +++++++++- routes/movies.js | 5 ++++- routes/rentals.js | 2 ++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/controllers/movies.js b/controllers/movies.js index f23e82eef..71c0c731e 100644 --- a/controllers/movies.js +++ b/controllers/movies.js @@ -2,9 +2,17 @@ MoviesController = { getMovies: function(req, res) { }, - + subsetMovies: function(req, res) { + }, + + getMoviesCurrent: function(req, res) { + + }, + + getMoviesHistory: function(req, res) { + } } diff --git a/routes/movies.js b/routes/movies.js index 896e64e66..f39452508 100644 --- a/routes/movies.js +++ b/routes/movies.js @@ -4,6 +4,9 @@ var Controller = require('../controllers/movies') router.get('/movies', Controller.getMovies) -router.get('/movies/sort/name?n=10&p=2', Controller.subsetMovies) +router.get('/movies/sort/release-date?n=10&p=2', Controller.subsetMovies) +router.get('/movies/:title/current', Controller.getMoviesCurrent) +router.get('/movies/:title/history', Controller.getMoviesHistory) + module.exports = router; diff --git a/routes/rentals.js b/routes/rentals.js index 3828aee96..5afc3e81f 100644 --- a/routes/rentals.js +++ b/routes/rentals.js @@ -7,4 +7,6 @@ var Controller = require('../controllers/rentals') // res.status(200).json({whatevs: 'whatevs!!!'}) // }); +router.get('/rentals', Controller.getRentals) + module.exports = router; From 60a395b3569b98955a9eab52e7bbc8d6a076d549 Mon Sep 17 00:00:00 2001 From: Leah Date: Tue, 14 Jun 2016 15:05:55 -0700 Subject: [PATCH 08/69] completed routes and controller setup --- controllers/rentals.js | 20 ++++++++++++++++++-- routes/rentals.js | 9 ++++++++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/controllers/rentals.js b/controllers/rentals.js index cf8cfe163..15f9431fd 100644 --- a/controllers/rentals.js +++ b/controllers/rentals.js @@ -1,7 +1,23 @@ RentalsController = { - // getRentals: function(req, res) { + getRentals: function(req, res) { - // } + }, + + getRentalsCustomers: function(req, res) { + + }, + + getRentalsCheckOut: function(req, res) { + + }, + + getRentalsReturn: function(req, res) { + + }, + + getRentalsOverdue: function(req, res) { + + } } module.exports = RentalsController \ No newline at end of file diff --git a/routes/rentals.js b/routes/rentals.js index 5afc3e81f..4ae6eb17c 100644 --- a/routes/rentals.js +++ b/routes/rentals.js @@ -7,6 +7,13 @@ var Controller = require('../controllers/rentals') // res.status(200).json({whatevs: 'whatevs!!!'}) // }); -router.get('/rentals', Controller.getRentals) +router.get('/rentals/:title', Controller.getRentals) +router.get('/rentals/:title/customers', Controller.getRentalsCustomers) +router.get('/rentals/:title/check-out', Controller.getRentalsCheckOut) +router.get('/rentals/:title/return', Controller.getRentalsReturn) +router.get('/rentals/overdue', Controller.getRentalsOverdue) + + + module.exports = router; From ffb9db482a7f041ed403234c67134e6f3defc455 Mon Sep 17 00:00:00 2001 From: Leah Date: Tue, 14 Jun 2016 15:55:36 -0700 Subject: [PATCH 09/69] added scripts to package.json --- controllers/customers.js | 5 +++-- package.json | 6 +++++- routes/customers.js | 11 ++--------- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/controllers/customers.js b/controllers/customers.js index 16e14c9fe..919ac0075 100644 --- a/controllers/customers.js +++ b/controllers/customers.js @@ -2,17 +2,18 @@ CustomersController = { getCustomers: function(req, res) { }, - + // customer id, sort column, offest ????? subsetCustomers: function(req, res) { }, + // customer id, all rentals attached to customer id within data params getCustomersCurrent: function(req, res) { }, getCustomersHistory: function(req, res) { - + } } diff --git a/package.json b/package.json index d39b26403..ca8a9648e 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,11 @@ "private": true, "scripts": { "start": "nodemon ./bin/www", - "test": "clear; jasmine-node --verbose spec/" + "test": "clear; jasmine-node --verbose spec/", + "db:drop": "dropdb scrabble_express", + "db:create": "createdb scrabble_express", + "db:schema": "node tasks/load_schema.js", + "db:seed": "seeddb scrabble_express" }, "dependencies": { "body-parser": "~1.13.2", diff --git a/routes/customers.js b/routes/customers.js index 1db8edf4f..08ffb652f 100644 --- a/routes/customers.js +++ b/routes/customers.js @@ -2,16 +2,9 @@ var express = require('express'); var router = express.Router(); var Controller = require('../controllers/customers') - - -/* GET home page. */ -// router.get('/', function(req, res, next) { -// res.status(200).json({whatevs: 'whatevs!!!'}) -// }); - - +// select all from db router.get('/customers', Controller.getCustomers) -// wtf - see instructions????? +// customer id, sort column, offest ????? router.get('/customers/sort/name?n=10&p=2', Controller.subsetCustomers) router.get('/customers/:id/current', Controller.getCustomersCurrent) router.get('/customers/:id/history', Controller.getCustomersHistory) From 7210590753c9b6216d54627652556e8cc77a99b3 Mon Sep 17 00:00:00 2001 From: Leah Date: Tue, 14 Jun 2016 16:09:05 -0700 Subject: [PATCH 10/69] create schema --- db/setup/schema.sql | 33 +++++++++++++++++++++++++++++++++ package.json | 1 + tasks/load_schema.js | 13 +++++++++++++ 3 files changed, 47 insertions(+) diff --git a/db/setup/schema.sql b/db/setup/schema.sql index e69de29bb..06b095bc3 100644 --- a/db/setup/schema.sql +++ b/db/setup/schema.sql @@ -0,0 +1,33 @@ +DROP TABLE IF EXISTS movies; +CREATE TABLE movies( + id serial PRIMARY KEY, + title text, + overview text, + release_date date, + inventory integer +); + +DROP TABLE IF EXISTS rentals; +CREATE TABLE rentals( + id serial PRIMARY KEY, + movie_id int, + customer_id int, + created_date date, + due_date date, + returned boolean +); + +DROP TABLE IF EXISTS customers; +CREATE TABLE customers( + id serial PRIMARY KEY, + name text, + registered_at timestamp, + address text, + city text, + state text, + postal_code text, + phone text, + account_credit money +); + +-- CREATE INDEX words_word ON words (word); diff --git a/package.json b/package.json index ca8a9648e..91f969ef3 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "debug": "~2.2.0", "express": "~4.13.1", "jade": "~1.11.0", + "massive": "^2.3.0", "morgan": "~1.6.1", "sequelize": "^3.23.3", "serve-favicon": "~2.3.0" diff --git a/tasks/load_schema.js b/tasks/load_schema.js index e69de29bb..4eefac1a6 100644 --- a/tasks/load_schema.js +++ b/tasks/load_schema.js @@ -0,0 +1,13 @@ +var massive = require('massive') +var connectionString = "postgres://localhost/video_store" + +var db = massive.connectSync({connectionString : connectionString}) + +db.setup.schema([], function(err, res) { + if (err) { + throw(new Error(err.message)) + } + + console.log("yay schema!") + process.exit() +}) From 609ea095af1a2e9b98592ce222f3609f8b3f8f4e Mon Sep 17 00:00:00 2001 From: Leah Date: Tue, 14 Jun 2016 16:20:33 -0700 Subject: [PATCH 11/69] added vars to app js for db --- app.js | 13 ++++++++++++- npm-debug.log | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 npm-debug.log diff --git a/app.js b/app.js index f0579b1dc..000d27fca 100644 --- a/app.js +++ b/app.js @@ -4,10 +4,21 @@ var favicon = require('serve-favicon'); var logger = require('morgan'); var cookieParser = require('cookie-parser'); var bodyParser = require('body-parser'); +var app = express(); +// +var massive = require("massive") +var connectionString = "postgres://localhost/video_store" + +// connect to Massive and get the db instance. You can safely use the +// convenience sync method here because its on app load +// you can also use loadSync - it's an alias +var massiveInstance = massive.connectSync({connectionString : connectionString}) + +// Set a reference to the massive instance on Express' app: +app.set('db', massiveInstance) var routes = require('./routes/index'); -var app = express(); // view engine setup app.set('views', path.join(__dirname, 'views')); diff --git a/npm-debug.log b/npm-debug.log new file mode 100644 index 000000000..63aa5ddbb --- /dev/null +++ b/npm-debug.log @@ -0,0 +1,48 @@ +0 info it worked if it ends with ok +1 verbose cli [ '/usr/local/Cellar/node/6.2.1/bin/node', +1 verbose cli '/usr/local/bin/npm', +1 verbose cli 'run', +1 verbose cli 'db:schema' ] +2 info using npm@3.9.3 +3 info using node@v6.2.1 +4 verbose run-script [ 'predb:schema', 'db:schema', 'postdb:schema' ] +5 info lifecycle video-store-api@0.0.0~predb:schema: video-store-api@0.0.0 +6 silly lifecycle video-store-api@0.0.0~predb:schema: no script for predb:schema, continuing +7 info lifecycle video-store-api@0.0.0~db:schema: video-store-api@0.0.0 +8 verbose lifecycle video-store-api@0.0.0~db:schema: unsafe-perm in lifecycle true +9 verbose lifecycle video-store-api@0.0.0~db:schema: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/leahpetersen/C5/projects/VideoStoreAPI/node_modules/.bin:/usr/local/Cellar/node/6.2.1/bin:/Users/leahpetersen/google-cloud-sdk/bin:/Users/leahpetersen/.rvm/gems/ruby-2.3.1/bin:/Users/leahpetersen/.rvm/gems/ruby-2.3.1@global/bin:/Users/leahpetersen/.rvm/rubies/ruby-2.3.1/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/leahpetersen/.rvm/bin:/Users/leahpetersen/.rvm/bin:/Users/leahpetersen/.rvm/bin +10 verbose lifecycle video-store-api@0.0.0~db:schema: CWD: /Users/leahpetersen/C5/projects/VideoStoreAPI +11 silly lifecycle video-store-api@0.0.0~db:schema: Args: [ '-c', 'node tasks/load_schema.js' ] +12 silly lifecycle video-store-api@0.0.0~db:schema: Returned: code: 1 signal: null +13 info lifecycle video-store-api@0.0.0~db:schema: Failed to exec db:schema script +14 verbose stack Error: video-store-api@0.0.0 db:schema: `node tasks/load_schema.js` +14 verbose stack Exit status 1 +14 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:245:16) +14 verbose stack at emitTwo (events.js:106:13) +14 verbose stack at EventEmitter.emit (events.js:191:7) +14 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14) +14 verbose stack at emitTwo (events.js:106:13) +14 verbose stack at ChildProcess.emit (events.js:191:7) +14 verbose stack at maybeClose (internal/child_process.js:852:16) +14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5) +15 verbose pkgid video-store-api@0.0.0 +16 verbose cwd /Users/leahpetersen/C5/projects/VideoStoreAPI +17 error Darwin 15.5.0 +18 error argv "/usr/local/Cellar/node/6.2.1/bin/node" "/usr/local/bin/npm" "run" "db:schema" +19 error node v6.2.1 +20 error npm v3.9.3 +21 error code ELIFECYCLE +22 error video-store-api@0.0.0 db:schema: `node tasks/load_schema.js` +22 error Exit status 1 +23 error Failed at the video-store-api@0.0.0 db:schema script 'node tasks/load_schema.js'. +23 error Make sure you have the latest version of node.js and npm installed. +23 error If you do, this is most likely a problem with the video-store-api package, +23 error not with npm itself. +23 error Tell the author that this fails on your system: +23 error node tasks/load_schema.js +23 error You can get information on how to open an issue for this project with: +23 error npm bugs video-store-api +23 error Or if that isn't available, you can get their info via: +23 error npm owner ls video-store-api +23 error There is likely additional logging output above. +24 verbose exit [ 1, true ] From 017f5856ef67b7e764e307f52da652205eee05dc Mon Sep 17 00:00:00 2001 From: Leah Date: Tue, 14 Jun 2016 16:34:44 -0700 Subject: [PATCH 12/69] create db and loaded schema --- app.js | 4 +-- db/setup/schema.sql | 4 +-- npm-debug.log | 81 ++++++++++++++++++++++----------------------- package.json | 3 +- routes/customers.js | 1 - 5 files changed, 44 insertions(+), 49 deletions(-) diff --git a/app.js b/app.js index 000d27fca..5a1da3f54 100644 --- a/app.js +++ b/app.js @@ -15,9 +15,8 @@ var connectionString = "postgres://localhost/video_store" var massiveInstance = massive.connectSync({connectionString : connectionString}) // Set a reference to the massive instance on Express' app: -app.set('db', massiveInstance) +app.set('db', massiveInstance); -var routes = require('./routes/index'); // view engine setup @@ -32,6 +31,7 @@ app.use(bodyParser.urlencoded({ extended: false })); app.use(cookieParser()); app.use(express.static(path.join(__dirname, 'public'))); +var routes = require('./routes/index'); app.use('/', routes); // catch 404 and forward to error handler diff --git a/db/setup/schema.sql b/db/setup/schema.sql index 06b095bc3..55596e72c 100644 --- a/db/setup/schema.sql +++ b/db/setup/schema.sql @@ -28,6 +28,4 @@ CREATE TABLE customers( postal_code text, phone text, account_credit money -); - --- CREATE INDEX words_word ON words (word); +); \ No newline at end of file diff --git a/npm-debug.log b/npm-debug.log index 63aa5ddbb..58919f959 100644 --- a/npm-debug.log +++ b/npm-debug.log @@ -2,47 +2,46 @@ 1 verbose cli [ '/usr/local/Cellar/node/6.2.1/bin/node', 1 verbose cli '/usr/local/bin/npm', 1 verbose cli 'run', -1 verbose cli 'db:schema' ] +1 verbose cli 'db:seed' ] 2 info using npm@3.9.3 3 info using node@v6.2.1 -4 verbose run-script [ 'predb:schema', 'db:schema', 'postdb:schema' ] -5 info lifecycle video-store-api@0.0.0~predb:schema: video-store-api@0.0.0 -6 silly lifecycle video-store-api@0.0.0~predb:schema: no script for predb:schema, continuing -7 info lifecycle video-store-api@0.0.0~db:schema: video-store-api@0.0.0 -8 verbose lifecycle video-store-api@0.0.0~db:schema: unsafe-perm in lifecycle true -9 verbose lifecycle video-store-api@0.0.0~db:schema: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/leahpetersen/C5/projects/VideoStoreAPI/node_modules/.bin:/usr/local/Cellar/node/6.2.1/bin:/Users/leahpetersen/google-cloud-sdk/bin:/Users/leahpetersen/.rvm/gems/ruby-2.3.1/bin:/Users/leahpetersen/.rvm/gems/ruby-2.3.1@global/bin:/Users/leahpetersen/.rvm/rubies/ruby-2.3.1/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/leahpetersen/.rvm/bin:/Users/leahpetersen/.rvm/bin:/Users/leahpetersen/.rvm/bin -10 verbose lifecycle video-store-api@0.0.0~db:schema: CWD: /Users/leahpetersen/C5/projects/VideoStoreAPI -11 silly lifecycle video-store-api@0.0.0~db:schema: Args: [ '-c', 'node tasks/load_schema.js' ] -12 silly lifecycle video-store-api@0.0.0~db:schema: Returned: code: 1 signal: null -13 info lifecycle video-store-api@0.0.0~db:schema: Failed to exec db:schema script -14 verbose stack Error: video-store-api@0.0.0 db:schema: `node tasks/load_schema.js` -14 verbose stack Exit status 1 -14 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:245:16) -14 verbose stack at emitTwo (events.js:106:13) -14 verbose stack at EventEmitter.emit (events.js:191:7) -14 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14) -14 verbose stack at emitTwo (events.js:106:13) -14 verbose stack at ChildProcess.emit (events.js:191:7) -14 verbose stack at maybeClose (internal/child_process.js:852:16) -14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5) -15 verbose pkgid video-store-api@0.0.0 -16 verbose cwd /Users/leahpetersen/C5/projects/VideoStoreAPI -17 error Darwin 15.5.0 -18 error argv "/usr/local/Cellar/node/6.2.1/bin/node" "/usr/local/bin/npm" "run" "db:schema" -19 error node v6.2.1 -20 error npm v3.9.3 +4 verbose run-script [ 'predb:seed', 'db:seed', 'postdb:seed' ] +5 info lifecycle video-store-api@0.0.0~predb:seed: video-store-api@0.0.0 +6 silly lifecycle video-store-api@0.0.0~predb:seed: no script for predb:seed, continuing +7 info lifecycle video-store-api@0.0.0~db:seed: video-store-api@0.0.0 +8 verbose lifecycle video-store-api@0.0.0~db:seed: unsafe-perm in lifecycle true +9 verbose lifecycle video-store-api@0.0.0~db:seed: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/leahpetersen/C5/projects/VideoStoreAPI/node_modules/.bin:/usr/local/Cellar/node/6.2.1/bin:/Users/leahpetersen/google-cloud-sdk/bin:/Users/leahpetersen/.rvm/gems/ruby-2.3.1/bin:/Users/leahpetersen/.rvm/gems/ruby-2.3.1@global/bin:/Users/leahpetersen/.rvm/rubies/ruby-2.3.1/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/leahpetersen/.rvm/bin:/Users/leahpetersen/.rvm/bin:/Users/leahpetersen/.rvm/bin +10 verbose lifecycle video-store-api@0.0.0~db:seed: CWD: /Users/leahpetersen/C5/projects/VideoStoreAPI +11 silly lifecycle video-store-api@0.0.0~db:seed: Args: [ '-c', 'seeddb video_store' ] +12 info lifecycle video-store-api@0.0.0~db:seed: Failed to exec db:seed script +13 verbose stack Error: video-store-api@0.0.0 db:seed: `seeddb video_store` +13 verbose stack spawn ENOENT +13 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:17:16) +13 verbose stack at emitTwo (events.js:106:13) +13 verbose stack at ChildProcess.emit (events.js:191:7) +13 verbose stack at maybeClose (internal/child_process.js:852:16) +13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5) +14 verbose pkgid video-store-api@0.0.0 +15 verbose cwd /Users/leahpetersen/C5/projects/VideoStoreAPI +16 error Darwin 15.5.0 +17 error argv "/usr/local/Cellar/node/6.2.1/bin/node" "/usr/local/bin/npm" "run" "db:seed" +18 error node v6.2.1 +19 error npm v3.9.3 +20 error file sh 21 error code ELIFECYCLE -22 error video-store-api@0.0.0 db:schema: `node tasks/load_schema.js` -22 error Exit status 1 -23 error Failed at the video-store-api@0.0.0 db:schema script 'node tasks/load_schema.js'. -23 error Make sure you have the latest version of node.js and npm installed. -23 error If you do, this is most likely a problem with the video-store-api package, -23 error not with npm itself. -23 error Tell the author that this fails on your system: -23 error node tasks/load_schema.js -23 error You can get information on how to open an issue for this project with: -23 error npm bugs video-store-api -23 error Or if that isn't available, you can get their info via: -23 error npm owner ls video-store-api -23 error There is likely additional logging output above. -24 verbose exit [ 1, true ] +22 error errno ENOENT +23 error syscall spawn +24 error video-store-api@0.0.0 db:seed: `seeddb video_store` +24 error spawn ENOENT +25 error Failed at the video-store-api@0.0.0 db:seed script 'seeddb video_store'. +25 error Make sure you have the latest version of node.js and npm installed. +25 error If you do, this is most likely a problem with the video-store-api package, +25 error not with npm itself. +25 error Tell the author that this fails on your system: +25 error seeddb video_store +25 error You can get information on how to open an issue for this project with: +25 error npm bugs video-store-api +25 error Or if that isn't available, you can get their info via: +25 error npm owner ls video-store-api +25 error There is likely additional logging output above. +26 verbose exit [ 1, true ] diff --git a/package.json b/package.json index 91f969ef3..5a08f4f4b 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "db:drop": "dropdb scrabble_express", "db:create": "createdb scrabble_express", "db:schema": "node tasks/load_schema.js", - "db:seed": "seeddb scrabble_express" + "db:seed": "seeddb video_store" }, "dependencies": { "body-parser": "~1.13.2", @@ -18,7 +18,6 @@ "jade": "~1.11.0", "massive": "^2.3.0", "morgan": "~1.6.1", - "sequelize": "^3.23.3", "serve-favicon": "~2.3.0" }, "devDependencies": { diff --git a/routes/customers.js b/routes/customers.js index 08ffb652f..f5be4e9e0 100644 --- a/routes/customers.js +++ b/routes/customers.js @@ -4,7 +4,6 @@ var Controller = require('../controllers/customers') // select all from db router.get('/customers', Controller.getCustomers) -// customer id, sort column, offest ????? router.get('/customers/sort/name?n=10&p=2', Controller.subsetCustomers) router.get('/customers/:id/current', Controller.getCustomersCurrent) router.get('/customers/:id/history', Controller.getCustomersHistory) From ac1de0358554ec4d54424b4ddef0a5a7594dbe76 Mon Sep 17 00:00:00 2001 From: Leah Date: Wed, 15 Jun 2016 14:09:53 -0700 Subject: [PATCH 13/69] added seed js file to auto seed from our json data --- db/seeds/load_json.js | 30 ++++++++++++++++++++++++++++++ tasks/seed.js | 24 ++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 db/seeds/load_json.js create mode 100644 tasks/seed.js diff --git a/db/seeds/load_json.js b/db/seeds/load_json.js new file mode 100644 index 000000000..25f4107cc --- /dev/null +++ b/db/seeds/load_json.js @@ -0,0 +1,30 @@ +// // Read Synchrously +// var fs = require("fs"); +// console.log("\n *START* \n"); +// // var movies = fs.readFileSync("content.txt"); +// // var customers = fs.readFileSync("content.txt"); +// console.log("Output Content : \n"+ content); +// console.log("\n *EXIT* \n"); + + + + +// var massive = require('massive') +// var connectionString = "postgres://localhost/video_store" +// var db = massive.connectSync({connectionString : connectionString}) + + + +var moviesParsedJSON = require('./movies.json'); +var customersParsedJSON = require('./customers.json'); + +console.log(moviesParsedJSON) +console.log(customersParsedJSON) + +// for(i = 0; i < parsedJSON.movies.length; i++) { +// db.saveDoc("movies", parsedJSON.movies[1], function(err,res){}); +// }; + +// for(i = 0; i < parsedJSON.customers.length; i++) { +// db.saveDoc("customer", customer_parsedJSON.customers[1], function(err,res){}); +// }; \ No newline at end of file diff --git a/tasks/seed.js b/tasks/seed.js new file mode 100644 index 000000000..2899b13cc --- /dev/null +++ b/tasks/seed.js @@ -0,0 +1,24 @@ +var massive = require('massive') +var connectionString = "postgres://localhost/video_store" +var db = massive.connectSync({connectionString : connectionString}) + +// produces array with each element is an object key:value pair +var moviesParsedJSON = require('../db/seeds/movies.json'); +var customersParsedJSON = require('../db/seeds/customers.json'); + +for (var movie of moviesParsedJSON) { + console.log(movie.title, ) + // pass save + // db.video_store.saveSync({movie: movie.title.....}) + db.video_store.saveSync(movie) +} + + +for (var customer of customersParsedJSON) { + console.log(customer.name, customer.registered_at, ) + // db.video_store.saveSync({name: customer.name, customer.registered_at, }) + db.video_store.saveSync(customer) +} + +console.log("seeding done!") +process.exit() \ No newline at end of file From 183072332ecfacbc44c0a8f2521c206665ceb67c Mon Sep 17 00:00:00 2001 From: Leah Date: Wed, 15 Jun 2016 14:10:33 -0700 Subject: [PATCH 14/69] deleted other file where we were trying to seed json data --- db/seeds/load_json.js | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 db/seeds/load_json.js diff --git a/db/seeds/load_json.js b/db/seeds/load_json.js deleted file mode 100644 index 25f4107cc..000000000 --- a/db/seeds/load_json.js +++ /dev/null @@ -1,30 +0,0 @@ -// // Read Synchrously -// var fs = require("fs"); -// console.log("\n *START* \n"); -// // var movies = fs.readFileSync("content.txt"); -// // var customers = fs.readFileSync("content.txt"); -// console.log("Output Content : \n"+ content); -// console.log("\n *EXIT* \n"); - - - - -// var massive = require('massive') -// var connectionString = "postgres://localhost/video_store" -// var db = massive.connectSync({connectionString : connectionString}) - - - -var moviesParsedJSON = require('./movies.json'); -var customersParsedJSON = require('./customers.json'); - -console.log(moviesParsedJSON) -console.log(customersParsedJSON) - -// for(i = 0; i < parsedJSON.movies.length; i++) { -// db.saveDoc("movies", parsedJSON.movies[1], function(err,res){}); -// }; - -// for(i = 0; i < parsedJSON.customers.length; i++) { -// db.saveDoc("customer", customer_parsedJSON.customers[1], function(err,res){}); -// }; \ No newline at end of file From 1a9d7adfe9c3350db6843a23a205c543dbcef174 Mon Sep 17 00:00:00 2001 From: Leah Date: Wed, 15 Jun 2016 15:32:02 -0700 Subject: [PATCH 15/69] seed success! seed js file working --- npm-debug.log | 47 ----------------------------------------------- package.json | 3 ++- tasks/seed.js | 44 +++++++++++++++++++++++++++++++++++++++----- 3 files changed, 41 insertions(+), 53 deletions(-) delete mode 100644 npm-debug.log diff --git a/npm-debug.log b/npm-debug.log deleted file mode 100644 index 58919f959..000000000 --- a/npm-debug.log +++ /dev/null @@ -1,47 +0,0 @@ -0 info it worked if it ends with ok -1 verbose cli [ '/usr/local/Cellar/node/6.2.1/bin/node', -1 verbose cli '/usr/local/bin/npm', -1 verbose cli 'run', -1 verbose cli 'db:seed' ] -2 info using npm@3.9.3 -3 info using node@v6.2.1 -4 verbose run-script [ 'predb:seed', 'db:seed', 'postdb:seed' ] -5 info lifecycle video-store-api@0.0.0~predb:seed: video-store-api@0.0.0 -6 silly lifecycle video-store-api@0.0.0~predb:seed: no script for predb:seed, continuing -7 info lifecycle video-store-api@0.0.0~db:seed: video-store-api@0.0.0 -8 verbose lifecycle video-store-api@0.0.0~db:seed: unsafe-perm in lifecycle true -9 verbose lifecycle video-store-api@0.0.0~db:seed: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/leahpetersen/C5/projects/VideoStoreAPI/node_modules/.bin:/usr/local/Cellar/node/6.2.1/bin:/Users/leahpetersen/google-cloud-sdk/bin:/Users/leahpetersen/.rvm/gems/ruby-2.3.1/bin:/Users/leahpetersen/.rvm/gems/ruby-2.3.1@global/bin:/Users/leahpetersen/.rvm/rubies/ruby-2.3.1/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/leahpetersen/.rvm/bin:/Users/leahpetersen/.rvm/bin:/Users/leahpetersen/.rvm/bin -10 verbose lifecycle video-store-api@0.0.0~db:seed: CWD: /Users/leahpetersen/C5/projects/VideoStoreAPI -11 silly lifecycle video-store-api@0.0.0~db:seed: Args: [ '-c', 'seeddb video_store' ] -12 info lifecycle video-store-api@0.0.0~db:seed: Failed to exec db:seed script -13 verbose stack Error: video-store-api@0.0.0 db:seed: `seeddb video_store` -13 verbose stack spawn ENOENT -13 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:17:16) -13 verbose stack at emitTwo (events.js:106:13) -13 verbose stack at ChildProcess.emit (events.js:191:7) -13 verbose stack at maybeClose (internal/child_process.js:852:16) -13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5) -14 verbose pkgid video-store-api@0.0.0 -15 verbose cwd /Users/leahpetersen/C5/projects/VideoStoreAPI -16 error Darwin 15.5.0 -17 error argv "/usr/local/Cellar/node/6.2.1/bin/node" "/usr/local/bin/npm" "run" "db:seed" -18 error node v6.2.1 -19 error npm v3.9.3 -20 error file sh -21 error code ELIFECYCLE -22 error errno ENOENT -23 error syscall spawn -24 error video-store-api@0.0.0 db:seed: `seeddb video_store` -24 error spawn ENOENT -25 error Failed at the video-store-api@0.0.0 db:seed script 'seeddb video_store'. -25 error Make sure you have the latest version of node.js and npm installed. -25 error If you do, this is most likely a problem with the video-store-api package, -25 error not with npm itself. -25 error Tell the author that this fails on your system: -25 error seeddb video_store -25 error You can get information on how to open an issue for this project with: -25 error npm bugs video-store-api -25 error Or if that isn't available, you can get their info via: -25 error npm owner ls video-store-api -25 error There is likely additional logging output above. -26 verbose exit [ 1, true ] diff --git a/package.json b/package.json index 5a08f4f4b..97639e261 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "db:drop": "dropdb scrabble_express", "db:create": "createdb scrabble_express", "db:schema": "node tasks/load_schema.js", - "db:seed": "seeddb video_store" + "db:seed": "node tasks/seed.js", + "reset": "npm run db:drop; npm run db:create; npm run db:schema; npm run db:seed;" }, "dependencies": { "body-parser": "~1.13.2", diff --git a/tasks/seed.js b/tasks/seed.js index 2899b13cc..3ee21f8ed 100644 --- a/tasks/seed.js +++ b/tasks/seed.js @@ -4,21 +4,55 @@ var db = massive.connectSync({connectionString : connectionString}) // produces array with each element is an object key:value pair var moviesParsedJSON = require('../db/seeds/movies.json'); +// var movieLength = moviesParsedJSON.length var customersParsedJSON = require('../db/seeds/customers.json'); +// var customerLength = customersParsedJSON.length + + +// ***********synchronous method for (var movie of moviesParsedJSON) { - console.log(movie.title, ) + console.log(movie) // pass save // db.video_store.saveSync({movie: movie.title.....}) - db.video_store.saveSync(movie) + db.movies.saveSync(movie); } for (var customer of customersParsedJSON) { - console.log(customer.name, customer.registered_at, ) + // console.log(customer.name, customer.registered_at, ) // db.video_store.saveSync({name: customer.name, customer.registered_at, }) - db.video_store.saveSync(customer) + db.customers.saveSync(customer); } console.log("seeding done!") -process.exit() \ No newline at end of file +process.exit() + + + + +// check length of db +// function checkFinish(records) { +// db.video_store.count(function(err, res) { +// console.log("words in db: ", res) +// // need to make sure both files are done +// if (res >= records) { process.exit() } +// }) +// } + +// // **********a-synchronous method +// for (var movie of moviesParsedJSON) { +// db.video_store.save(movie, function(err, res) { +// console.log('saved: ', JSON.stringify(res)) +// checkFinish(movieLength) +// }) +// } + +// for (var customer of customersParsedJSON) { +// db.video_store.save(customer, function(err, res) { +// console.log('saved: ', JSON.stringify(res)) +// checkFinish(customerLength) +// }) +// } + + From f62cec9abf64711c2f622f7c05ba5d1394bd9cea Mon Sep 17 00:00:00 2001 From: Leah Date: Thu, 16 Jun 2016 14:00:01 -0700 Subject: [PATCH 16/69] no changes --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 97639e261..ea9e493cf 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,8 @@ "scripts": { "start": "nodemon ./bin/www", "test": "clear; jasmine-node --verbose spec/", - "db:drop": "dropdb scrabble_express", - "db:create": "createdb scrabble_express", + "db:drop": "dropdb video_store", + "db:create": "createdb video_store", "db:schema": "node tasks/load_schema.js", "db:seed": "node tasks/seed.js", "reset": "npm run db:drop; npm run db:create; npm run db:schema; npm run db:seed;" From 5017a8d41f4816c1e89de2860afc8051f0e17ddc Mon Sep 17 00:00:00 2001 From: Alysia Brown Date: Thu, 16 Jun 2016 14:12:18 -0700 Subject: [PATCH 17/69] Added Customer.all model method. --- models/customers_model.js | 18 ++++++++++++++++++ models/movies_model.js | 0 models/rentals_model.js | 0 3 files changed, 18 insertions(+) create mode 100644 models/customers_model.js create mode 100644 models/movies_model.js create mode 100644 models/rentals_model.js diff --git a/models/customers_model.js b/models/customers_model.js new file mode 100644 index 000000000..3f35754c2 --- /dev/null +++ b/models/customers_model.js @@ -0,0 +1,18 @@ +var app = require("../app"); +var db = app.get("db"); + +var Customer = function(id) { + this.id = id; +} + +Customer.all = function(callback) { + db.customers.find(function(error, accounts) { + if (error|| !customers) { + callback(error || new Error("Could not retrieve customers"), undefined); + } else { + callback(null, customers.map(function(customer) { + return new Customer(customer.id); + })) + }; + }) +}; diff --git a/models/movies_model.js b/models/movies_model.js new file mode 100644 index 000000000..e69de29bb diff --git a/models/rentals_model.js b/models/rentals_model.js new file mode 100644 index 000000000..e69de29bb From 2c1687c07ebbc17978524c25f3eb9ced23f38b20 Mon Sep 17 00:00:00 2001 From: Alysia Brown Date: Thu, 16 Jun 2016 14:31:40 -0700 Subject: [PATCH 18/69] Added Customer.all model and controller methods. Cleaned up funky code. --- app.js | 17 +++++++++++++---- controllers/customers.js | 16 ++++++++++++++-- models/customers_model.js | 4 +++- models/movies_model.js | 8 ++++++++ models/rentals_model.js | 7 +++++++ routes/customers.js | 8 ++++---- routes/movies.js | 8 ++++---- routes/rentals.js | 10 +++++----- 8 files changed, 58 insertions(+), 20 deletions(-) diff --git a/app.js b/app.js index 5a1da3f54..95b844b9d 100644 --- a/app.js +++ b/app.js @@ -4,8 +4,8 @@ var favicon = require('serve-favicon'); var logger = require('morgan'); var cookieParser = require('cookie-parser'); var bodyParser = require('body-parser'); -var app = express(); -// +var app = module.exports = express(); +// var massive = require("massive") var connectionString = "postgres://localhost/video_store" @@ -18,7 +18,6 @@ var massiveInstance = massive.connectSync({connectionString : connectionString}) app.set('db', massiveInstance); - // view engine setup app.set('views', path.join(__dirname, 'views')); app.set('view engine', 'jade'); @@ -31,8 +30,18 @@ app.use(bodyParser.urlencoded({ extended: false })); app.use(cookieParser()); app.use(express.static(path.join(__dirname, 'public'))); -var routes = require('./routes/index'); +var routes = require('./routes/index'); +var customers = require('./routes/customers'); +var movies = require('./routes/movies'); +var rentals = require('./routes/rentals'); + + + app.use('/', routes); +app.use('/customers', customers); +app.use('/movies', movies); +app.use('/rentals', rentals); + // catch 404 and forward to error handler app.use(function(req, res, next) { diff --git a/controllers/customers.js b/controllers/customers.js index 919ac0075..82ede41db 100644 --- a/controllers/customers.js +++ b/controllers/customers.js @@ -1,5 +1,17 @@ -CustomersController = { +var Customer = require("../models/customers_model"); + + + +var CustomersController = { getCustomers: function(req, res) { + Customer.all(function(error, customers) { + if(error) { + var err = new Error("Error retrieving account list;\n" + error.message); + err.status = 500; + } else { + res.json(customers) + } + }) }, // customer id, sort column, offest ????? @@ -17,4 +29,4 @@ CustomersController = { } } -module.exports = CustomersController \ No newline at end of file +module.exports = CustomersController diff --git a/models/customers_model.js b/models/customers_model.js index 3f35754c2..e63a78ed1 100644 --- a/models/customers_model.js +++ b/models/customers_model.js @@ -6,7 +6,7 @@ var Customer = function(id) { } Customer.all = function(callback) { - db.customers.find(function(error, accounts) { + db.customers.find(function(error, customers) { if (error|| !customers) { callback(error || new Error("Could not retrieve customers"), undefined); } else { @@ -16,3 +16,5 @@ Customer.all = function(callback) { }; }) }; + +module.exports = Customer; diff --git a/models/movies_model.js b/models/movies_model.js index e69de29bb..f3879a8da 100644 --- a/models/movies_model.js +++ b/models/movies_model.js @@ -0,0 +1,8 @@ + + + + + + + +module.exports = Movie; diff --git a/models/rentals_model.js b/models/rentals_model.js index e69de29bb..bf7216d87 100644 --- a/models/rentals_model.js +++ b/models/rentals_model.js @@ -0,0 +1,7 @@ + + + + + + +module.exports = Rental; diff --git a/routes/customers.js b/routes/customers.js index f5be4e9e0..998fef0f7 100644 --- a/routes/customers.js +++ b/routes/customers.js @@ -3,10 +3,10 @@ var router = express.Router(); var Controller = require('../controllers/customers') // select all from db -router.get('/customers', Controller.getCustomers) -router.get('/customers/sort/name?n=10&p=2', Controller.subsetCustomers) -router.get('/customers/:id/current', Controller.getCustomersCurrent) -router.get('/customers/:id/history', Controller.getCustomersHistory) +router.get('/', Controller.getCustomers) +router.get('/sort/name?n=10&p=2', Controller.subsetCustomers) +router.get('/:id/current', Controller.getCustomersCurrent) +router.get('/:id/history', Controller.getCustomersHistory) module.exports = router; diff --git a/routes/movies.js b/routes/movies.js index f39452508..2371b5427 100644 --- a/routes/movies.js +++ b/routes/movies.js @@ -3,10 +3,10 @@ var router = express.Router(); var Controller = require('../controllers/movies') -router.get('/movies', Controller.getMovies) -router.get('/movies/sort/release-date?n=10&p=2', Controller.subsetMovies) -router.get('/movies/:title/current', Controller.getMoviesCurrent) -router.get('/movies/:title/history', Controller.getMoviesHistory) +router.get('/', Controller.getMovies) +router.get('/sort/release-date?n=10&p=2', Controller.subsetMovies) +router.get('/:title/current', Controller.getMoviesCurrent) +router.get('/:title/history', Controller.getMoviesHistory) module.exports = router; diff --git a/routes/rentals.js b/routes/rentals.js index 4ae6eb17c..c461f7073 100644 --- a/routes/rentals.js +++ b/routes/rentals.js @@ -7,11 +7,11 @@ var Controller = require('../controllers/rentals') // res.status(200).json({whatevs: 'whatevs!!!'}) // }); -router.get('/rentals/:title', Controller.getRentals) -router.get('/rentals/:title/customers', Controller.getRentalsCustomers) -router.get('/rentals/:title/check-out', Controller.getRentalsCheckOut) -router.get('/rentals/:title/return', Controller.getRentalsReturn) -router.get('/rentals/overdue', Controller.getRentalsOverdue) +router.get('/:title', Controller.getRentals) +router.get('/:title/customers', Controller.getRentalsCustomers) +router.get('/:title/check-out', Controller.getRentalsCheckOut) +router.get('/:title/return', Controller.getRentalsReturn) +router.get('/overdue', Controller.getRentalsOverdue) From 94e3dd3cb7d2ab86fd7d61a67c95c930e873e765 Mon Sep 17 00:00:00 2001 From: Alysia Brown Date: Thu, 16 Jun 2016 14:35:24 -0700 Subject: [PATCH 19/69] Added getMovie model and controller methods. --- controllers/movies.js | 16 +++++++++++++--- models/movies_model.js | 17 +++++++++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/controllers/movies.js b/controllers/movies.js index 71c0c731e..a9a59cdff 100644 --- a/controllers/movies.js +++ b/controllers/movies.js @@ -1,6 +1,16 @@ +var Movie = require("../models/movies_model"); + + MoviesController = { getMovies: function(req, res) { - + Movie.all(function(error, movies) { + if(error) { + var err = new Error("Error retrieving movie list;\n" + error.message); + err.status = 500; + } else { + res.json(movies) + } + }) }, subsetMovies: function(req, res) { @@ -12,8 +22,8 @@ MoviesController = { }, getMoviesHistory: function(req, res) { - + } } -module.exports = MoviesController \ No newline at end of file +module.exports = MoviesController diff --git a/models/movies_model.js b/models/movies_model.js index f3879a8da..438a290c7 100644 --- a/models/movies_model.js +++ b/models/movies_model.js @@ -1,4 +1,21 @@ +var app = require("../app"); +var db = app.get("db"); +var Movie = function(id) { + this.id = id; +} + +Movie.all = function(callback) { + db.movies.find(function(error, movies) { + if (error|| !movies) { + callback(error || new Error("Could not retrieve movies"), undefined); + } else { + callback(null, movies.map(function(movie) { + return new Movie(movie.id); + })) + }; + }) +}; From 0cb8c704a602da04d7ff270cb4af776aa863d68f Mon Sep 17 00:00:00 2001 From: Alysia Brown Date: Thu, 16 Jun 2016 16:33:30 -0700 Subject: [PATCH 20/69] Structured the getRentals function and associated functions. --- app.js | 2 +- controllers/rentals.js | 19 ++++++++++++++++--- models/movies_model.js | 18 +++++++++++++++--- models/rentals_model.js | 19 +++++++++++++++++++ 4 files changed, 51 insertions(+), 7 deletions(-) diff --git a/app.js b/app.js index 95b844b9d..a2387eb5e 100644 --- a/app.js +++ b/app.js @@ -4,9 +4,9 @@ var favicon = require('serve-favicon'); var logger = require('morgan'); var cookieParser = require('cookie-parser'); var bodyParser = require('body-parser'); +var massive = require("massive"); var app = module.exports = express(); // -var massive = require("massive") var connectionString = "postgres://localhost/video_store" // connect to Massive and get the db instance. You can safely use the diff --git a/controllers/rentals.js b/controllers/rentals.js index 15f9431fd..f3735e595 100644 --- a/controllers/rentals.js +++ b/controllers/rentals.js @@ -1,6 +1,19 @@ +var Rental = require("../models/rentals_model"); +var Movie = require("../models/movies_model"); + RentalsController = { getRentals: function(req, res) { - + Movie.findMovie(req.params.title, function(error, movie) { + if(error) { + var err = new Error("No such movie"); + err.status = 404; + } else { + Rental.getCheckedOut(movie.id, function(error, checked_out) { + res.json(checked_out) + }) + } + + }) }, getRentalsCustomers: function(req, res) { @@ -16,8 +29,8 @@ RentalsController = { }, getRentalsOverdue: function(req, res) { - + } } -module.exports = RentalsController \ No newline at end of file +module.exports = RentalsController diff --git a/models/movies_model.js b/models/movies_model.js index 438a290c7..0545e3006 100644 --- a/models/movies_model.js +++ b/models/movies_model.js @@ -1,8 +1,8 @@ var app = require("../app"); var db = app.get("db"); -var Movie = function(id) { - this.id = id; +var Movie = function(title) { + this.title = title; } Movie.all = function(callback) { @@ -11,12 +11,24 @@ Movie.all = function(callback) { callback(error || new Error("Could not retrieve movies"), undefined); } else { callback(null, movies.map(function(movie) { - return new Movie(movie.id); + return new Movie(movie.title); })) }; }) }; +Movie.findMovie = function(title, callback) { + db.movies.findOne({title: title}, function(error, movie) { + + if (error || !movie) { + + callback(error || new Error("Movie not found"), undefined); + } else { + callback(null, new Movie(movie.title)); + } + }) +}; + diff --git a/models/rentals_model.js b/models/rentals_model.js index bf7216d87..c3a94c5ea 100644 --- a/models/rentals_model.js +++ b/models/rentals_model.js @@ -1,3 +1,22 @@ +var app = require("../app"); +var db = app.get("db"); + +var Rental = function(title) { + this.title = title +}; + +Rental.getCheckedOut = function(id, callback) { + db.rentals.findOne(this.title, function(error, rental) { + if(error) { + callback(error, undefined); + } else { + var checked_out = 0; + callback(null, checked_out); + } + }) +} + + From 7475951e77ab93dfc1642ef893c193b8a074c046 Mon Sep 17 00:00:00 2001 From: Alysia Brown Date: Thu, 16 Jun 2016 16:51:14 -0700 Subject: [PATCH 21/69] EOD commit. --- models/rentals_model.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/models/rentals_model.js b/models/rentals_model.js index c3a94c5ea..97f7da828 100644 --- a/models/rentals_model.js +++ b/models/rentals_model.js @@ -1,16 +1,17 @@ var app = require("../app"); var db = app.get("db"); -var Rental = function(title) { - this.title = title +var Rental = function(id) { + this.id = id }; -Rental.getCheckedOut = function(id, callback) { - db.rentals.findOne(this.title, function(error, rental) { +Rental.getCheckedOut = function(movie_id, callback) { + // Not sure if this would return in an array or if we'd have to convert it to an array + var array = db.rentals.where("movie_id=$1 AND returned=$2", [movie_id, false], function(error, rental) { if(error) { callback(error, undefined); } else { - var checked_out = 0; + var checked_out = array.length; callback(null, checked_out); } }) @@ -20,7 +21,4 @@ Rental.getCheckedOut = function(id, callback) { - - - module.exports = Rental; From 66d9160b200cf5d1ead863cde96c5a664de55391 Mon Sep 17 00:00:00 2001 From: Leah Date: Fri, 17 Jun 2016 10:22:57 -0700 Subject: [PATCH 22/69] implemented customer sort --- controllers/customers.js | 8 ++++++++ models/customers_model.js | 17 +++++++++++++++++ routes/customers.js | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/controllers/customers.js b/controllers/customers.js index 82ede41db..47e8d8147 100644 --- a/controllers/customers.js +++ b/controllers/customers.js @@ -16,7 +16,15 @@ var CustomersController = { }, // customer id, sort column, offest ????? subsetCustomers: function(req, res) { + Customer.sort(req.params.column, req.query.p, req.query.n, function(error, data) { + if(error) { + var err = new Error("No such data"); + err.status = 404; + } else { + res.json(data) + } + }) }, // customer id, all rentals attached to customer id within data params diff --git a/models/customers_model.js b/models/customers_model.js index e63a78ed1..c8927e373 100644 --- a/models/customers_model.js +++ b/models/customers_model.js @@ -17,4 +17,21 @@ Customer.all = function(callback) { }) }; +Customer.sort = function(column, p, n, callback) { + // sort by column, for n number of records starting at p + db.customers.find({}, { + order: column, + limit: n, + offset: p + }, function(error, customers) { + if (error || !customers) { + callback(error || new Error("Could not retrieve customers"), undefined) + } else { + callback(null, customers.map (function (customer) { + return customer + })) + } + }) +} + module.exports = Customer; diff --git a/routes/customers.js b/routes/customers.js index 998fef0f7..90d571d4b 100644 --- a/routes/customers.js +++ b/routes/customers.js @@ -4,7 +4,7 @@ var Controller = require('../controllers/customers') // select all from db router.get('/', Controller.getCustomers) -router.get('/sort/name?n=10&p=2', Controller.subsetCustomers) +router.get('/sort/:column', Controller.subsetCustomers) router.get('/:id/current', Controller.getCustomersCurrent) router.get('/:id/history', Controller.getCustomersHistory) From 7272d8c5a39a75a7e37c89c105eb3d7cdc5ac177 Mon Sep 17 00:00:00 2001 From: Leah Date: Fri, 17 Jun 2016 10:31:09 -0700 Subject: [PATCH 23/69] added sort movie functions --- controllers/movies.js | 8 ++++++++ models/movies_model.js | 17 +++++++++++++++++ routes/movies.js | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/controllers/movies.js b/controllers/movies.js index a9a59cdff..742cd42e5 100644 --- a/controllers/movies.js +++ b/controllers/movies.js @@ -14,7 +14,15 @@ MoviesController = { }, subsetMovies: function(req, res) { + Movie.sort(req.params.column, req.query.p, req.query.n, function(error, data) { + if(error) { + var err = new Error("No such data"); + err.status = 404; + } else { + res.json(data) + } + }) }, getMoviesCurrent: function(req, res) { diff --git a/models/movies_model.js b/models/movies_model.js index 0545e3006..0a0049ba3 100644 --- a/models/movies_model.js +++ b/models/movies_model.js @@ -29,6 +29,23 @@ Movie.findMovie = function(title, callback) { }) }; +Movie.sort = function(column, p, n, callback) { + // sort by column, for n number of records starting at p + db.movies.find({}, { + order: column, + limit: n, + offset: p + }, function(error, movies) { + if (error || !movies) { + callback(error || new Error("Could not retrieve movies"), undefined) + } else { + callback(null, movies.map (function (movie) { + return movie + })) + } + }) +} + diff --git a/routes/movies.js b/routes/movies.js index 2371b5427..57f46ea78 100644 --- a/routes/movies.js +++ b/routes/movies.js @@ -4,7 +4,7 @@ var Controller = require('../controllers/movies') router.get('/', Controller.getMovies) -router.get('/sort/release-date?n=10&p=2', Controller.subsetMovies) +router.get('/sort/:column', Controller.subsetMovies) router.get('/:title/current', Controller.getMoviesCurrent) router.get('/:title/history', Controller.getMoviesHistory) From 778a4b2692de76d913043561e284ae43283ebee9 Mon Sep 17 00:00:00 2001 From: Leah Date: Fri, 17 Jun 2016 11:04:24 -0700 Subject: [PATCH 24/69] added rentals seed data --- db/seeds/rentals.json | 23 +++++++++++++++++++++++ tasks/seed.js | 12 +++++++++--- 2 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 db/seeds/rentals.json diff --git a/db/seeds/rentals.json b/db/seeds/rentals.json new file mode 100644 index 000000000..12d415881 --- /dev/null +++ b/db/seeds/rentals.json @@ -0,0 +1,23 @@ +[ +{ +"movie_id": 40, +"customer_id": 5, +"created_date": "1960-06-16", +"due_date": "1960-06-18", +"returned": true +}, +{ +"movie_id": 40, +"customer_id": 5, +"created_date": "1960-06-16", +"due_date": "2016-06-28", +"returned": false +}, +{ +"movie_id": 40, +"customer_id": 5, +"created_date": "1965-06-16", +"due_date": "1960-06-18", +"returned": true +} +] \ No newline at end of file diff --git a/tasks/seed.js b/tasks/seed.js index 3ee21f8ed..df307ee82 100644 --- a/tasks/seed.js +++ b/tasks/seed.js @@ -7,7 +7,7 @@ var moviesParsedJSON = require('../db/seeds/movies.json'); // var movieLength = moviesParsedJSON.length var customersParsedJSON = require('../db/seeds/customers.json'); // var customerLength = customersParsedJSON.length - +var rentalsParsedJSON = require('../db/seeds/rentals.json'); // ***********synchronous method @@ -16,14 +16,20 @@ for (var movie of moviesParsedJSON) { // pass save // db.video_store.saveSync({movie: movie.title.....}) db.movies.saveSync(movie); -} +}; for (var customer of customersParsedJSON) { // console.log(customer.name, customer.registered_at, ) // db.video_store.saveSync({name: customer.name, customer.registered_at, }) db.customers.saveSync(customer); -} +}; + +for (var rental of rentalsParsedJSON) { + // console.log(customer.name, customer.registered_at, ) + // db.video_store.saveSync({name: customer.name, customer.registered_at, }) + db.rentals.saveSync(rental); +}; console.log("seeding done!") process.exit() From 04a70b191bff5fda4e1b4e5c69549b64c59d284e Mon Sep 17 00:00:00 2001 From: Leah Date: Fri, 17 Jun 2016 11:13:31 -0700 Subject: [PATCH 25/69] added function to return currently checked out videos for givien customer id --- controllers/customers.js | 10 +++++++++- models/rentals_model.js | 9 +++++++++ routes/customers.js | 4 ++-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/controllers/customers.js b/controllers/customers.js index 47e8d8147..f14e0b1d7 100644 --- a/controllers/customers.js +++ b/controllers/customers.js @@ -1,5 +1,5 @@ var Customer = require("../models/customers_model"); - +var Rental = require("../models/rentals_model"); var CustomersController = { @@ -29,7 +29,15 @@ var CustomersController = { // customer id, all rentals attached to customer id within data params getCustomersCurrent: function(req, res) { + Rental.getCurrentRentals(req.params.customer_id, function(error, data) { + if(error) { + var err = new Error("No such data"); + err.status = 404; + } else { + res.json(data) + } + }) }, getCustomersHistory: function(req, res) { diff --git a/models/rentals_model.js b/models/rentals_model.js index 97f7da828..cc9248ac1 100644 --- a/models/rentals_model.js +++ b/models/rentals_model.js @@ -17,6 +17,15 @@ Rental.getCheckedOut = function(movie_id, callback) { }) } +Rental.getCurrentRentals = function(customer_id, callback) { + db.rentals.where("customer_id=$1 AND returned=$2", [customer_id, false], function(error, checked_out) { + if(error) { + callback(error, undefined); + } else { + callback(null, checked_out); + } + }) +} diff --git a/routes/customers.js b/routes/customers.js index 90d571d4b..89d6a3852 100644 --- a/routes/customers.js +++ b/routes/customers.js @@ -5,8 +5,8 @@ var Controller = require('../controllers/customers') // select all from db router.get('/', Controller.getCustomers) router.get('/sort/:column', Controller.subsetCustomers) -router.get('/:id/current', Controller.getCustomersCurrent) -router.get('/:id/history', Controller.getCustomersHistory) +router.get('/:customer_id/current', Controller.getCustomersCurrent) +router.get('/:customer_id/history', Controller.getCustomersHistory) module.exports = router; From b245782e2f7a931d145b60f845bb01d6d4fa43f9 Mon Sep 17 00:00:00 2001 From: Leah Date: Fri, 17 Jun 2016 11:21:19 -0700 Subject: [PATCH 26/69] added get rental history for given id --- controllers/customers.js | 12 ++++++++---- models/rentals_model.js | 9 +++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/controllers/customers.js b/controllers/customers.js index f14e0b1d7..37a3535cf 100644 --- a/controllers/customers.js +++ b/controllers/customers.js @@ -23,7 +23,6 @@ var CustomersController = { } else { res.json(data) } - }) }, @@ -36,13 +35,18 @@ var CustomersController = { } else { res.json(data) } - }) }, getCustomersHistory: function(req, res) { - + Rental.getPastRentals(req.params.customer_id, function(error, data) { + if(error) { + var err = new Error("No such data"); + err.status = 404; + } else { + res.json(data) + } + }) } } - module.exports = CustomersController diff --git a/models/rentals_model.js b/models/rentals_model.js index cc9248ac1..40f9ff9bb 100644 --- a/models/rentals_model.js +++ b/models/rentals_model.js @@ -27,6 +27,15 @@ Rental.getCurrentRentals = function(customer_id, callback) { }) } +Rental.getPastRentals = function(customer_id, callback) { + db.rentals.where("customer_id=$1 AND returned=$2", [customer_id, true], function(error, checked_out) { + if(error) { + callback(error, undefined); + } else { + callback(null, checked_out); + } + }) +} From 481795d76dbd3e75efe2dae08d203fa01ce6a8c6 Mon Sep 17 00:00:00 2001 From: Leah Date: Fri, 17 Jun 2016 13:52:11 -0700 Subject: [PATCH 27/69] working on returning data from movie and rentals models to get inventory --- controllers/movies.js | 2 +- controllers/rentals.js | 13 +++++++++++++ models/movies_model.js | 5 +++-- models/rentals_model.js | 16 +++++++++++++--- 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/controllers/movies.js b/controllers/movies.js index 742cd42e5..8b90de9ab 100644 --- a/controllers/movies.js +++ b/controllers/movies.js @@ -19,7 +19,7 @@ MoviesController = { var err = new Error("No such data"); err.status = 404; } else { - res.json(data) + res.json(data) } }) diff --git a/controllers/rentals.js b/controllers/rentals.js index f3735e595..d92ff91ac 100644 --- a/controllers/rentals.js +++ b/controllers/rentals.js @@ -3,12 +3,16 @@ var Movie = require("../models/movies_model"); RentalsController = { getRentals: function(req, res) { + + Movie.findMovie(req.params.title, function(error, movie) { if(error) { var err = new Error("No such movie"); err.status = 404; } else { Rental.getCheckedOut(movie.id, function(error, checked_out) { + // get checkout int and minus from inventory (from movie instance) + console.log(checked_out) res.json(checked_out) }) } @@ -29,7 +33,16 @@ RentalsController = { }, getRentalsOverdue: function(req, res) { + console.log("AAAALLLOOO????") + Rental.getOverdue(function(error, over_due) { + if(error) { + var err = new Error("Ooops"); + err.status = 404; + } else { + res.json(over_due) + } + }) } } diff --git a/models/movies_model.js b/models/movies_model.js index 0a0049ba3..5b0e40b75 100644 --- a/models/movies_model.js +++ b/models/movies_model.js @@ -1,8 +1,9 @@ var app = require("../app"); var db = app.get("db"); -var Movie = function(title) { +var Movie = function(title, inventory) { this.title = title; + this.inventory = inventory; } Movie.all = function(callback) { @@ -24,7 +25,7 @@ Movie.findMovie = function(title, callback) { callback(error || new Error("Movie not found"), undefined); } else { - callback(null, new Movie(movie.title)); + callback(null, new Movie(movie.title, movie.inventory)); } }) }; diff --git a/models/rentals_model.js b/models/rentals_model.js index 40f9ff9bb..103ce623a 100644 --- a/models/rentals_model.js +++ b/models/rentals_model.js @@ -5,13 +5,12 @@ var Rental = function(id) { this.id = id }; -Rental.getCheckedOut = function(movie_id, callback) { +Rental.getCheckedOut = function(title, callback) { // Not sure if this would return in an array or if we'd have to convert it to an array - var array = db.rentals.where("movie_id=$1 AND returned=$2", [movie_id, false], function(error, rental) { + db.rentals.where("title=$1 AND returned=$2", [title, false], function(error, checked_out) { if(error) { callback(error, undefined); } else { - var checked_out = array.length; callback(null, checked_out); } }) @@ -37,6 +36,17 @@ Rental.getPastRentals = function(customer_id, callback) { }) } +Rental.getOverdue = function(callback) { + var now = new Date().toISOString().split('T')[0]; + db.rentals.where("returned=$1 AND due_date<$2", [false, now], function(error, overdue) { + if(error) { + callback(error, undefined); + } else { + callback(null, overdue); + } + }) +} + module.exports = Rental; From 8f2444c98ead6f98129fff673c3f2ee588d816a6 Mon Sep 17 00:00:00 2001 From: Leah Date: Mon, 20 Jun 2016 10:30:53 -0700 Subject: [PATCH 28/69] added instanbul --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index ea9e493cf..6e664e2c8 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "start": "nodemon ./bin/www", - "test": "clear; jasmine-node --verbose spec/", + "test": "clear; istanbul cover --include-all-sources jasmine-node --verbose spec/", "db:drop": "dropdb video_store", "db:create": "createdb video_store", "db:schema": "node tasks/load_schema.js", @@ -22,6 +22,7 @@ "serve-favicon": "~2.3.0" }, "devDependencies": { + "istanbul": "^0.4.4", "jasmine-node": "^1.14.5", "nodemon": "^1.9.2", "request": "^2.72.0" From 39b10c7cacb120380d0f0bd076b6eff01f52179a Mon Sep 17 00:00:00 2001 From: Leah Date: Mon, 20 Jun 2016 10:44:16 -0700 Subject: [PATCH 29/69] changed schema to include returned date --- db/seeds/rentals.json | 6 ++++-- db/setup/schema.sql | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/db/seeds/rentals.json b/db/seeds/rentals.json index 12d415881..3a682704d 100644 --- a/db/seeds/rentals.json +++ b/db/seeds/rentals.json @@ -4,7 +4,8 @@ "customer_id": 5, "created_date": "1960-06-16", "due_date": "1960-06-18", -"returned": true +"returned": true, +"returned_date": "1960-06-18" }, { "movie_id": 40, @@ -18,6 +19,7 @@ "customer_id": 5, "created_date": "1965-06-16", "due_date": "1960-06-18", -"returned": true +"returned": true, +"returned_date": "1960-06-18" } ] \ No newline at end of file diff --git a/db/setup/schema.sql b/db/setup/schema.sql index 55596e72c..758f3e835 100644 --- a/db/setup/schema.sql +++ b/db/setup/schema.sql @@ -14,7 +14,8 @@ CREATE TABLE rentals( customer_id int, created_date date, due_date date, - returned boolean + returned boolean, + returned_date date ); DROP TABLE IF EXISTS customers; From dec1418e1ec0877b951577323ebfe82937c4ff7c Mon Sep 17 00:00:00 2001 From: Leah Date: Mon, 20 Jun 2016 10:59:42 -0700 Subject: [PATCH 30/69] added getpastchecked out method that returns past rentals and sorts by returned date --- db/seeds/rentals.json | 18 ++++++++++++++---- models/rentals_model.js | 4 ++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/db/seeds/rentals.json b/db/seeds/rentals.json index 3a682704d..0f7ebf8fc 100644 --- a/db/seeds/rentals.json +++ b/db/seeds/rentals.json @@ -2,10 +2,10 @@ { "movie_id": 40, "customer_id": 5, -"created_date": "1960-06-16", -"due_date": "1960-06-18", +"created_date": "1980-06-16", +"due_date": "1980-06-18", "returned": true, -"returned_date": "1960-06-18" +"returned_date": "1980-06-18" }, { "movie_id": 40, @@ -17,9 +17,19 @@ { "movie_id": 40, "customer_id": 5, -"created_date": "1965-06-16", +"created_date": "1960-06-16", "due_date": "1960-06-18", "returned": true, "returned_date": "1960-06-18" +}, +{ +"movie_id": 40, +"customer_id": 5, +"created_date": "1970-06-16", +"due_date": "1970-06-18", +"returned": true, +"returned_date": "1967-06-18" } + + ] \ No newline at end of file diff --git a/models/rentals_model.js b/models/rentals_model.js index 103ce623a..e99ec815c 100644 --- a/models/rentals_model.js +++ b/models/rentals_model.js @@ -27,11 +27,11 @@ Rental.getCurrentRentals = function(customer_id, callback) { } Rental.getPastRentals = function(customer_id, callback) { - db.rentals.where("customer_id=$1 AND returned=$2", [customer_id, true], function(error, checked_out) { + db.run("SELECT customer_id, created_date, movie_id, returned_date FROM rentals WHERE customer_id=$1 AND returned=$2 ORDER BY returned_date ASC", [customer_id, true], function(error, past_rentals) { if(error) { callback(error, undefined); } else { - callback(null, checked_out); + callback(null, past_rentals); } }) } From c948e37163820d9d12d83b71551ba6526e80e84e Mon Sep 17 00:00:00 2001 From: Leah Date: Mon, 20 Jun 2016 13:17:29 -0700 Subject: [PATCH 31/69] added function to get all current customers who have checked out film by name) --- controllers/rentals.js | 12 ++++++--- db/seeds/rentals.json | 8 +++--- models/# Leah Petersen | 60 +++++++++++++++++++++++++++++++++++++++++ models/rentals_model.js | 10 +++++++ 4 files changed, 82 insertions(+), 8 deletions(-) create mode 100644 models/# Leah Petersen diff --git a/controllers/rentals.js b/controllers/rentals.js index d92ff91ac..a06f3b498 100644 --- a/controllers/rentals.js +++ b/controllers/rentals.js @@ -3,8 +3,6 @@ var Movie = require("../models/movies_model"); RentalsController = { getRentals: function(req, res) { - - Movie.findMovie(req.params.title, function(error, movie) { if(error) { var err = new Error("No such movie"); @@ -21,7 +19,14 @@ RentalsController = { }, getRentalsCustomers: function(req, res) { - + Rental.getCustomers(req.params.title, function(error, checked_out) { + if(error) { + var err = new Error("No one has that movie checked out"); + err.status = 404; + } else { + res.json(checked_out) + } + }) }, getRentalsCheckOut: function(req, res) { @@ -41,7 +46,6 @@ RentalsController = { } else { res.json(over_due) } - }) } } diff --git a/db/seeds/rentals.json b/db/seeds/rentals.json index 0f7ebf8fc..4a3e59de5 100644 --- a/db/seeds/rentals.json +++ b/db/seeds/rentals.json @@ -1,6 +1,6 @@ [ { -"movie_id": 40, +"movie_id": 2, "customer_id": 5, "created_date": "1980-06-16", "due_date": "1980-06-18", @@ -8,14 +8,14 @@ "returned_date": "1980-06-18" }, { -"movie_id": 40, +"movie_id": 2, "customer_id": 5, "created_date": "1960-06-16", "due_date": "2016-06-28", "returned": false }, { -"movie_id": 40, +"movie_id": 2, "customer_id": 5, "created_date": "1960-06-16", "due_date": "1960-06-18", @@ -23,7 +23,7 @@ "returned_date": "1960-06-18" }, { -"movie_id": 40, +"movie_id": 2, "customer_id": 5, "created_date": "1970-06-16", "due_date": "1970-06-18", diff --git a/models/# Leah Petersen b/models/# Leah Petersen new file mode 100644 index 000000000..2c247e475 --- /dev/null +++ b/models/# Leah Petersen @@ -0,0 +1,60 @@ +# Leah Petersen + +[Email](mailto:leahnpetersen@gmail.com) / [LinkedIn](https://www.linkedin.com/in/leahstunts) / [GitHub](http://github.com/leahnp) / [Personal Website](http://leahstunts.com ) + +Motorcycle stunt woman turned computer programmer. + +## Work Experience + +### LeahStunts +**Self-Employed International Stunt Woman** +*2008-2015 | Los Angeles, CA & Marseille, France* + +* Created and brought to life "LeahStunts" brand +* Performed live shows throughout Asia, Europe, South America and North America +* Appeared in national and international TV commercials, TV shows and music videos +* Established working relationships with major sponsors +* Designed and maintained website and online presence +* Produced promotional photography and videos +* Freelance writing and copywriting for brands and publications + +### StuntBums +**Co-Creator, Owner, Creative Director** +*2010-2015 | Los Angeles, CA & Marseille, France* + +* Created and brought to life "StuntBums" brand +* Partnered with several national and international stunt competition series +* Developed YouTube Channel with over 27 million views (videos self-produced) +* Focused on bringing legitimacy, safety and nurturing global community for motorcycle stunt riding +* Expanded to Europe in 2010 by earning a "Competence and Talents" visa from France + +### Mirrorball Agency +**Account Manager, Harley-Davidson** +*2009-2010 | New York, NY* + +* Managed account for Harley-Davidson Young Adult experiential marketing events +* Oversaw project development and execution for nationwide events +* Developed and pitched concepts to client +* Worked with external creative, logistics and talent teams + +### California State University, Northridge +**Research Assistant** +*2007-2009 | Northridge, CA* + +* Developed admission method for graduate program +* Managed and processed surveys for active students in program +* Used SPSS and Survey Monkey + +## Technical Skills + +**Languages:** Ruby, HTML, CSS, JavaScript, Python +**Frameworks & Libraries:** Javascript, Rails, Sinatra, Bootstrap, NodeJS, SQLite +**Tools:** Git, GitHub, Google Cloud Services, Heroku, Sublime, Slack, Trello, Bash +**Methodologies:** RESTful APIs, MVC, TDD, Pair Programming + + +## Education + +[**Ada Developers Academy**](http://http://adadevelopersacademy.org/), Seattle, WA (January 2016 - current) / Intensive Web Development Program + +[**Sarah Lawrence College**](https://www.sarahlawrence.edu/), Bronxville, NY/Florence, Italy (2007) / Bachelor of Arts diff --git a/models/rentals_model.js b/models/rentals_model.js index e99ec815c..2791e1e2b 100644 --- a/models/rentals_model.js +++ b/models/rentals_model.js @@ -36,6 +36,16 @@ Rental.getPastRentals = function(customer_id, callback) { }) } +Rental.getCustomers = function(movie_title, callback) { + db.run("SELECT customer_id FROM rentals WHERE movie_id=(SELECT id FROM movies WHERE title=$1) AND returned=false", [movie_title], function(error, customers) { + if(error) { + callback(error, undefined); + } else { + callback(null, customers); + } + }) +} + Rental.getOverdue = function(callback) { var now = new Date().toISOString().split('T')[0]; db.rentals.where("returned=$1 AND due_date<$2", [false, now], function(error, overdue) { From 273a5af7b0d5f2ca01c8bb5bcf0ef00a45129022 Mon Sep 17 00:00:00 2001 From: Leah Date: Mon, 20 Jun 2016 13:38:56 -0700 Subject: [PATCH 32/69] linked rentals & movies to use same function to return list of customers currently having that film checked out --- controllers/movies.js | 12 ++++++++++-- models/SELECT customers.* | 31 +++++++++++++++++++++++++++++++ models/rentals_model.js | 2 +- routes/movies.js | 2 +- 4 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 models/SELECT customers.* diff --git a/controllers/movies.js b/controllers/movies.js index 8b90de9ab..704e39a04 100644 --- a/controllers/movies.js +++ b/controllers/movies.js @@ -1,4 +1,5 @@ var Movie = require("../models/movies_model"); +var Rental = require("../models/rentals_model"); MoviesController = { @@ -25,8 +26,15 @@ MoviesController = { }) }, - getMoviesCurrent: function(req, res) { - + getRentalsCustomers: function(req, res) { + Rental.getCustomers(req.params.title, function(error, checked_out) { + if(error) { + var err = new Error("No one has that movie checked out"); + err.status = 404; + } else { + res.json(checked_out) + } + }) }, getMoviesHistory: function(req, res) { diff --git a/models/SELECT customers.* b/models/SELECT customers.* new file mode 100644 index 000000000..01e6d5474 --- /dev/null +++ b/models/SELECT customers.* @@ -0,0 +1,31 @@ +SELECT customers.* +FROM movies +INNER JOIN rentals +ON rentals.movie_id=movies.id +INNER JOIN customers ON customers.id=rentals.customer_id +WHERE rentals.checked = $1 AND movies.title=$2 +ORDER BY " + query + ";" + + + +SELECT customers.* +SELECT customer_id +FROM rentals +WHERE movie_id=(SELECT id FROM movies WHERE title=$1) AND returned=false +INNER JOIN customers on + +", [movie_title] + + +"SELECT * FROM customers WHERE id=(SELECT customer_id FROM rentals WHERE movie_id=(SELECT id FROM movies WHERE title=$1) AND returned=false)"" + + + + + +db.run("SELECT id FROM movies WHERE title=$1 AS moviee + SELECT rentals.customer_id + FROM rentals + INNER JOIN movies + ON rentals.movie_id=movies.id + WHERE moviee AND rentals.returned=false", [movie_title], diff --git a/models/rentals_model.js b/models/rentals_model.js index 2791e1e2b..5c9d09ea6 100644 --- a/models/rentals_model.js +++ b/models/rentals_model.js @@ -37,7 +37,7 @@ Rental.getPastRentals = function(customer_id, callback) { } Rental.getCustomers = function(movie_title, callback) { - db.run("SELECT customer_id FROM rentals WHERE movie_id=(SELECT id FROM movies WHERE title=$1) AND returned=false", [movie_title], function(error, customers) { + db.run("SELECT * FROM customers WHERE id=(SELECT customer_id FROM rentals WHERE movie_id=(SELECT id FROM movies WHERE title=$1) AND returned=false)", [movie_title], function(error, customers) { if(error) { callback(error, undefined); } else { diff --git a/routes/movies.js b/routes/movies.js index 57f46ea78..558420d2e 100644 --- a/routes/movies.js +++ b/routes/movies.js @@ -5,7 +5,7 @@ var Controller = require('../controllers/movies') router.get('/', Controller.getMovies) router.get('/sort/:column', Controller.subsetMovies) -router.get('/:title/current', Controller.getMoviesCurrent) +router.get('/:title/current', Controller.getRentalsCustomers) router.get('/:title/history', Controller.getMoviesHistory) From 8a0f7ec143721a21daf4b4868e5753fe35521c17 Mon Sep 17 00:00:00 2001 From: Alysia Brown Date: Mon, 20 Jun 2016 14:40:22 -0700 Subject: [PATCH 33/69] Break push. --- controllers/rentals.js | 10 ++++++- models/# Leah Petersen | 60 --------------------------------------- models/SELECT customers.* | 31 -------------------- models/rentals_model.js | 18 ++++++++++-- routes/rentals.js | 7 +---- 5 files changed, 26 insertions(+), 100 deletions(-) delete mode 100644 models/# Leah Petersen delete mode 100644 models/SELECT customers.* diff --git a/controllers/rentals.js b/controllers/rentals.js index a06f3b498..d92382bc5 100644 --- a/controllers/rentals.js +++ b/controllers/rentals.js @@ -30,7 +30,15 @@ RentalsController = { }, getRentalsCheckOut: function(req, res) { - + Rental.getCheckout(req.params.title, req.params.customer_id, function(error, checked_out) { + if(error) { + var err = new Error("No one has that movie checked out"); + console.log("hi") + err.status = 404; + } else { + res.json(req.params.customer_id) + } + }) }, getRentalsReturn: function(req, res) { diff --git a/models/# Leah Petersen b/models/# Leah Petersen deleted file mode 100644 index 2c247e475..000000000 --- a/models/# Leah Petersen +++ /dev/null @@ -1,60 +0,0 @@ -# Leah Petersen - -[Email](mailto:leahnpetersen@gmail.com) / [LinkedIn](https://www.linkedin.com/in/leahstunts) / [GitHub](http://github.com/leahnp) / [Personal Website](http://leahstunts.com ) - -Motorcycle stunt woman turned computer programmer. - -## Work Experience - -### LeahStunts -**Self-Employed International Stunt Woman** -*2008-2015 | Los Angeles, CA & Marseille, France* - -* Created and brought to life "LeahStunts" brand -* Performed live shows throughout Asia, Europe, South America and North America -* Appeared in national and international TV commercials, TV shows and music videos -* Established working relationships with major sponsors -* Designed and maintained website and online presence -* Produced promotional photography and videos -* Freelance writing and copywriting for brands and publications - -### StuntBums -**Co-Creator, Owner, Creative Director** -*2010-2015 | Los Angeles, CA & Marseille, France* - -* Created and brought to life "StuntBums" brand -* Partnered with several national and international stunt competition series -* Developed YouTube Channel with over 27 million views (videos self-produced) -* Focused on bringing legitimacy, safety and nurturing global community for motorcycle stunt riding -* Expanded to Europe in 2010 by earning a "Competence and Talents" visa from France - -### Mirrorball Agency -**Account Manager, Harley-Davidson** -*2009-2010 | New York, NY* - -* Managed account for Harley-Davidson Young Adult experiential marketing events -* Oversaw project development and execution for nationwide events -* Developed and pitched concepts to client -* Worked with external creative, logistics and talent teams - -### California State University, Northridge -**Research Assistant** -*2007-2009 | Northridge, CA* - -* Developed admission method for graduate program -* Managed and processed surveys for active students in program -* Used SPSS and Survey Monkey - -## Technical Skills - -**Languages:** Ruby, HTML, CSS, JavaScript, Python -**Frameworks & Libraries:** Javascript, Rails, Sinatra, Bootstrap, NodeJS, SQLite -**Tools:** Git, GitHub, Google Cloud Services, Heroku, Sublime, Slack, Trello, Bash -**Methodologies:** RESTful APIs, MVC, TDD, Pair Programming - - -## Education - -[**Ada Developers Academy**](http://http://adadevelopersacademy.org/), Seattle, WA (January 2016 - current) / Intensive Web Development Program - -[**Sarah Lawrence College**](https://www.sarahlawrence.edu/), Bronxville, NY/Florence, Italy (2007) / Bachelor of Arts diff --git a/models/SELECT customers.* b/models/SELECT customers.* deleted file mode 100644 index 01e6d5474..000000000 --- a/models/SELECT customers.* +++ /dev/null @@ -1,31 +0,0 @@ -SELECT customers.* -FROM movies -INNER JOIN rentals -ON rentals.movie_id=movies.id -INNER JOIN customers ON customers.id=rentals.customer_id -WHERE rentals.checked = $1 AND movies.title=$2 -ORDER BY " + query + ";" - - - -SELECT customers.* -SELECT customer_id -FROM rentals -WHERE movie_id=(SELECT id FROM movies WHERE title=$1) AND returned=false -INNER JOIN customers on - -", [movie_title] - - -"SELECT * FROM customers WHERE id=(SELECT customer_id FROM rentals WHERE movie_id=(SELECT id FROM movies WHERE title=$1) AND returned=false)"" - - - - - -db.run("SELECT id FROM movies WHERE title=$1 AS moviee - SELECT rentals.customer_id - FROM rentals - INNER JOIN movies - ON rentals.movie_id=movies.id - WHERE moviee AND rentals.returned=false", [movie_title], diff --git a/models/rentals_model.js b/models/rentals_model.js index 5c9d09ea6..b780815a4 100644 --- a/models/rentals_model.js +++ b/models/rentals_model.js @@ -1,8 +1,14 @@ var app = require("../app"); var db = app.get("db"); -var Rental = function(id) { - this.id = id +var Rental = function(movie_id, customer_id, created_date, due_date, returned = false, returned_date = null) { + this.movie_id = movie_id; + this.customer_id = customer_id; + this.created_date = created_date; + this.due_date = due_date; + this.returned = returned; + this.returned_date = returned_date; + }; Rental.getCheckedOut = function(title, callback) { @@ -57,6 +63,14 @@ Rental.getOverdue = function(callback) { }) } +Rental.prototype.getCheckout = function(movie_title, customer_id, callback) { + var movie_id = db.run("SELECT id FROM movies WHERE title = movie_title") + var created_date = new Date().toISOString().split('T')[0]; + var due_date = created_date.setDate(created_date.getDate()+7); + + var rental = Rental.new(movie_id, customer_id, created_date, due_date) + +} module.exports = Rental; diff --git a/routes/rentals.js b/routes/rentals.js index c461f7073..4629e0276 100644 --- a/routes/rentals.js +++ b/routes/rentals.js @@ -2,14 +2,9 @@ var express = require('express'); var router = express.Router(); var Controller = require('../controllers/rentals') -/* GET home page. */ -// router.get('/', function(req, res, next) { -// res.status(200).json({whatevs: 'whatevs!!!'}) -// }); - router.get('/:title', Controller.getRentals) router.get('/:title/customers', Controller.getRentalsCustomers) -router.get('/:title/check-out', Controller.getRentalsCheckOut) +router.post('/:title/check-out/:customer_id', Controller.getRentalsCheckOut) router.get('/:title/return', Controller.getRentalsReturn) router.get('/overdue', Controller.getRentalsOverdue) From 4f96be0b9940b7ec1da9d6c2506e07d8db782508 Mon Sep 17 00:00:00 2001 From: Alysia Brown Date: Mon, 20 Jun 2016 16:12:47 -0700 Subject: [PATCH 34/69] Slayed our own dragons. --- controllers/rentals.js | 6 +++--- models/rentals_model.js | 18 ++++++++++++++---- routes/rentals.js | 2 +- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/controllers/rentals.js b/controllers/rentals.js index d92382bc5..33cef35b3 100644 --- a/controllers/rentals.js +++ b/controllers/rentals.js @@ -30,13 +30,13 @@ RentalsController = { }, getRentalsCheckOut: function(req, res) { - Rental.getCheckout(req.params.title, req.params.customer_id, function(error, checked_out) { + console.log("BEBEBELKRSEELSKERSEJRLSER:))") + Rental.getCheckout(req.params.title, req.params.customerid, function(error, checked_out) { if(error) { var err = new Error("No one has that movie checked out"); - console.log("hi") err.status = 404; } else { - res.json(req.params.customer_id) + res.json(checked_out) } }) }, diff --git a/models/rentals_model.js b/models/rentals_model.js index b780815a4..1f0da6d11 100644 --- a/models/rentals_model.js +++ b/models/rentals_model.js @@ -63,12 +63,22 @@ Rental.getOverdue = function(callback) { }) } -Rental.prototype.getCheckout = function(movie_title, customer_id, callback) { - var movie_id = db.run("SELECT id FROM movies WHERE title = movie_title") - var created_date = new Date().toISOString().split('T')[0]; +Rental.getCheckout = function(movie_title, customer_id, callback) { + var moobie_id = db.run("SELECT id FROM movies WHERE title = $1", [movie_title]) + var created_date = new Date() + // answer = new Date(due_date).toUTCString() converts milli's to datetime var due_date = created_date.setDate(created_date.getDate()+7); - var rental = Rental.new(movie_id, customer_id, created_date, due_date) + var rented_copies = db.run("SELECT COUNT(*) FROM rentals WHERE movie_id = $1 AND returned=false", [moobie_id]) + var inventory = db.run("SELECT inventory FROM movies WHERE title = $1", [movie_title]) + + if (inventory - rented_copies > 0) { + var rental = Rental.new(moobie_id, customer_id, created_date, due_date); + db.rentals.save(rental); + callback(null, due_date); + } else { + callback(null, undefined); + } } diff --git a/routes/rentals.js b/routes/rentals.js index 4629e0276..5e076e06e 100644 --- a/routes/rentals.js +++ b/routes/rentals.js @@ -4,7 +4,7 @@ var Controller = require('../controllers/rentals') router.get('/:title', Controller.getRentals) router.get('/:title/customers', Controller.getRentalsCustomers) -router.post('/:title/check-out/:customer_id', Controller.getRentalsCheckOut) +router.get('/:title/check-out/:customerid', Controller.getRentalsCheckOut) router.get('/:title/return', Controller.getRentalsReturn) router.get('/overdue', Controller.getRentalsOverdue) From 7cec0fa5ba83a599ad6b27a8421c77482d64d35e Mon Sep 17 00:00:00 2001 From: Leah Date: Mon, 20 Jun 2016 16:52:13 -0700 Subject: [PATCH 35/69] working on getCheckout in rentals model, currently settime object is not being able to turn into string --- models/rentals_model.js | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/models/rentals_model.js b/models/rentals_model.js index 1f0da6d11..57c153ee9 100644 --- a/models/rentals_model.js +++ b/models/rentals_model.js @@ -63,23 +63,23 @@ Rental.getOverdue = function(callback) { }) } -Rental.getCheckout = function(movie_title, customer_id, callback) { - var moobie_id = db.run("SELECT id FROM movies WHERE title = $1", [movie_title]) - var created_date = new Date() - // answer = new Date(due_date).toUTCString() converts milli's to datetime - var due_date = created_date.setDate(created_date.getDate()+7); - - var rented_copies = db.run("SELECT COUNT(*) FROM rentals WHERE movie_id = $1 AND returned=false", [moobie_id]) - var inventory = db.run("SELECT inventory FROM movies WHERE title = $1", [movie_title]) - - if (inventory - rented_copies > 0) { - var rental = Rental.new(moobie_id, customer_id, created_date, due_date); - db.rentals.save(rental); - callback(null, due_date); - } else { - callback(null, undefined); - } - +Rental.getCheckout = function(movie_title, id, callback) { + // var moobie_id = db.run("SELECT id FROM movies WHERE title = $1", [movie_title]) + // var created_date = new Date() + // // answer = new Date(due_date).toUTCString() converts milli's to datetime + // var due_date = created_date.setDate(created_date.getDate()+7); + // movie_id, customer_id, created_date, due_date + // db.run("SELECT id FROM movies WHERE title = $1", [movie_title]) + console.log(movie_title) + db.rentals.save({movie_id: (db.run("SELECT id FROM movies WHERE title = $1", [movie_title])), customer_id: id, created_date: (new Date().toISOString().split('T')[0]), due_date: (new Date().setDate(new Date().getDate()+7).toISOString().split('T')[0])}), function(error, data) { + if(error) { + callback(error, undefined); + } else { + // var rental = Rental.new(moobie_id, customer_id, new Date(), new Date().setDate(created_date.getDate()+7), due_date); + // db.rentals.save(rental); + callback(null, data); + } + } } From 8546c07583e7d296072910ee9c712e6d07bef276 Mon Sep 17 00:00:00 2001 From: Leah Date: Mon, 20 Jun 2016 19:32:20 -0700 Subject: [PATCH 36/69] fixed getCheck method to check out movie by name and customer id --- app.js | 2 ++ controllers/rentals.js | 12 +++++------ models/rentals_model.js | 47 +++++++++++++++++++++++++++-------------- routes/rentals.js | 1 + 4 files changed, 40 insertions(+), 22 deletions(-) diff --git a/app.js b/app.js index a2387eb5e..de44c805a 100644 --- a/app.js +++ b/app.js @@ -25,6 +25,8 @@ app.set('view engine', 'jade'); // uncomment after placing your favicon in /public //app.use(favicon(path.join(__dirname, 'public', 'favicon.ico'))); app.use(logger('dev')); +// this will terminate the request with an error 400 if the POST body +// doesn't contain valid json app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: false })); app.use(cookieParser()); diff --git a/controllers/rentals.js b/controllers/rentals.js index 33cef35b3..062f22eb3 100644 --- a/controllers/rentals.js +++ b/controllers/rentals.js @@ -29,16 +29,16 @@ RentalsController = { }) }, - getRentalsCheckOut: function(req, res) { + getRentalsCheckOut: function(req, res, next) { console.log("BEBEBELKRSEELSKERSEJRLSER:))") Rental.getCheckout(req.params.title, req.params.customerid, function(error, checked_out) { - if(error) { - var err = new Error("No one has that movie checked out"); - err.status = 404; - } else { + if(error) { + var err = new Error("No one has that movie checked out"); + err.status = 404; + } else { res.json(checked_out) } - }) + }); }, getRentalsReturn: function(req, res) { diff --git a/models/rentals_model.js b/models/rentals_model.js index 57c153ee9..a00a44f49 100644 --- a/models/rentals_model.js +++ b/models/rentals_model.js @@ -64,23 +64,38 @@ Rental.getOverdue = function(callback) { } Rental.getCheckout = function(movie_title, id, callback) { - // var moobie_id = db.run("SELECT id FROM movies WHERE title = $1", [movie_title]) - // var created_date = new Date() - // // answer = new Date(due_date).toUTCString() converts milli's to datetime - // var due_date = created_date.setDate(created_date.getDate()+7); - // movie_id, customer_id, created_date, due_date - // db.run("SELECT id FROM movies WHERE title = $1", [movie_title]) - console.log(movie_title) - db.rentals.save({movie_id: (db.run("SELECT id FROM movies WHERE title = $1", [movie_title])), customer_id: id, created_date: (new Date().toISOString().split('T')[0]), due_date: (new Date().setDate(new Date().getDate()+7).toISOString().split('T')[0])}), function(error, data) { - if(error) { - callback(error, undefined); - } else { - // var rental = Rental.new(moobie_id, customer_id, new Date(), new Date().setDate(created_date.getDate()+7), due_date); - // db.rentals.save(rental); - callback(null, data); + // get movie id from movie table by title + db.movies.findOne({ + title: movie_title + // call back with movie id + }, function (error, movie) { + if (error) { + return callback(error); + } else if (!movie) { + return callback(new Error("Movie not found")); } - } -} + // set date vars + var now = new Date(); + var due = new Date(now); + due.setDate(due.getDate() + 7); + + // save new rental (nested inside find) + db.rentals.save({ + movie_id: movie.id, + customer_id: id, + created_date: now, + due_date: due, + returned: false + // callback with rental info + }, function (error, rental) { + if (error) { + return callback(error); + } + // pass rental back to controller + return callback(null, rental); + }); + }); +} module.exports = Rental; diff --git a/routes/rentals.js b/routes/rentals.js index 5e076e06e..4ef452dea 100644 --- a/routes/rentals.js +++ b/routes/rentals.js @@ -4,6 +4,7 @@ var Controller = require('../controllers/rentals') router.get('/:title', Controller.getRentals) router.get('/:title/customers', Controller.getRentalsCustomers) +// can't post from browser URL router.get('/:title/check-out/:customerid', Controller.getRentalsCheckOut) router.get('/:title/return', Controller.getRentalsReturn) router.get('/overdue', Controller.getRentalsOverdue) From 43d3e4620fdf371bad422bb225bdbf714fdca7b7 Mon Sep 17 00:00:00 2001 From: Leah Date: Tue, 21 Jun 2016 10:04:56 -0700 Subject: [PATCH 37/69] make checkouts subtract 2 dollars from customer account balance --- controllers/rentals.js | 1 - db/setup/schema.sql | 2 +- models/rentals_model.js | 61 ++++++++++++++++++++++++++++------------- 3 files changed, 43 insertions(+), 21 deletions(-) diff --git a/controllers/rentals.js b/controllers/rentals.js index 062f22eb3..211b01623 100644 --- a/controllers/rentals.js +++ b/controllers/rentals.js @@ -30,7 +30,6 @@ RentalsController = { }, getRentalsCheckOut: function(req, res, next) { - console.log("BEBEBELKRSEELSKERSEJRLSER:))") Rental.getCheckout(req.params.title, req.params.customerid, function(error, checked_out) { if(error) { var err = new Error("No one has that movie checked out"); diff --git a/db/setup/schema.sql b/db/setup/schema.sql index 758f3e835..e13cb391e 100644 --- a/db/setup/schema.sql +++ b/db/setup/schema.sql @@ -28,5 +28,5 @@ CREATE TABLE customers( state text, postal_code text, phone text, - account_credit money + account_credit decimal ); \ No newline at end of file diff --git a/models/rentals_model.js b/models/rentals_model.js index a00a44f49..d6f3c62e0 100644 --- a/models/rentals_model.js +++ b/models/rentals_model.js @@ -75,25 +75,48 @@ Rental.getCheckout = function(movie_title, id, callback) { return callback(new Error("Movie not found")); } - // set date vars - var now = new Date(); - var due = new Date(now); - due.setDate(due.getDate() + 7); - - // save new rental (nested inside find) - db.rentals.save({ - movie_id: movie.id, - customer_id: id, - created_date: now, - due_date: due, - returned: false - // callback with rental info - }, function (error, rental) { - if (error) { - return callback(error); - } - // pass rental back to controller - return callback(null, rental); + // remove money from account + db.run("UPDATE customers SET account_credit=account_credit-2.0 WHERE id=$1;", [id], function (error, movie_id = movie, account_balance_update) { + if (error) { + return callback(error); + } + + // db.customers.update( + // {id: id, + // account_credit: 2.0 + // }, function (error, movie_id = movie, account_balance_update) { + // if (error) { + // return callback(error); + // } + + + // } else if (!account_balance_update) { + // console.log("aaaaalllooooo") + // // return callback(new Error("Money not able to be removed from account")); + // callback + // } + + + // set date vars + var now = new Date(); + var due = new Date(now); + due.setDate(due.getDate() + 7); + + // save new rental (nested inside find) + db.rentals.save({ + movie_id: movie_id.id, + customer_id: id, + created_date: now, + due_date: due, + returned: false + // callback with rental info + }, function (error, rental) { + if (error) { + return callback(error); + } + // pass rental back to controller + return callback(null, rental); + }); }); }); } From 969b34685dab43d175107e7611dac5bc46ca34a0 Mon Sep 17 00:00:00 2001 From: Leah Date: Tue, 21 Jun 2016 10:17:53 -0700 Subject: [PATCH 38/69] added returned method to return a rental --- controllers/rentals.js | 8 ++++++++ models/rentals_model.js | 30 ++++++++++++++---------------- routes/rentals.js | 4 +++- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/controllers/rentals.js b/controllers/rentals.js index 211b01623..4cf0d6cbc 100644 --- a/controllers/rentals.js +++ b/controllers/rentals.js @@ -41,6 +41,14 @@ RentalsController = { }, getRentalsReturn: function(req, res) { + Rental.getReturn(req.params.id, function(error, returned) { + if(error) { + var err = new Error("No one has that movie checked out"); + err.status = 404; + } else { + res.json(returned) + } + }); }, diff --git a/models/rentals_model.js b/models/rentals_model.js index d6f3c62e0..77f6f16e7 100644 --- a/models/rentals_model.js +++ b/models/rentals_model.js @@ -63,6 +63,20 @@ Rental.getOverdue = function(callback) { }) } +Rental.getReturn = function(rental_id, callback) { + db.rentals.update({ + id: rental_id, + returned: true, + returned_date: new Date() + }, function(error, checked_out) { + if(error) { + callback(error, undefined); + } else { + callback(null, checked_out); + } + }) +} + Rental.getCheckout = function(movie_title, id, callback) { // get movie id from movie table by title db.movies.findOne({ @@ -81,22 +95,6 @@ Rental.getCheckout = function(movie_title, id, callback) { return callback(error); } - // db.customers.update( - // {id: id, - // account_credit: 2.0 - // }, function (error, movie_id = movie, account_balance_update) { - // if (error) { - // return callback(error); - // } - - - // } else if (!account_balance_update) { - // console.log("aaaaalllooooo") - // // return callback(new Error("Money not able to be removed from account")); - // callback - // } - - // set date vars var now = new Date(); var due = new Date(now); diff --git a/routes/rentals.js b/routes/rentals.js index 4ef452dea..16d6fda3d 100644 --- a/routes/rentals.js +++ b/routes/rentals.js @@ -6,7 +6,9 @@ router.get('/:title', Controller.getRentals) router.get('/:title/customers', Controller.getRentalsCustomers) // can't post from browser URL router.get('/:title/check-out/:customerid', Controller.getRentalsCheckOut) -router.get('/:title/return', Controller.getRentalsReturn) +// must pass rental id, sorry.... +// passing movie titles is UNRELIABLE! +router.get('/return/:id', Controller.getRentalsReturn) router.get('/overdue', Controller.getRentalsOverdue) From d2ac33e21c36ae15181ca288fe9025ba14398f10 Mon Sep 17 00:00:00 2001 From: Leah Date: Tue, 21 Jun 2016 12:56:05 -0700 Subject: [PATCH 39/69] working on getoverdue function, need to find object that will respond to the current date --- controllers/rentals.js | 3 +-- db/seeds/rentals.json | 2 +- models/rentals_model.js | 42 +++++++++++++++++++++++++++++++++++------ routes/rentals.js | 2 +- 4 files changed, 39 insertions(+), 10 deletions(-) diff --git a/controllers/rentals.js b/controllers/rentals.js index 4cf0d6cbc..a4c34c465 100644 --- a/controllers/rentals.js +++ b/controllers/rentals.js @@ -53,7 +53,6 @@ RentalsController = { }, getRentalsOverdue: function(req, res) { - console.log("AAAALLLOOO????") Rental.getOverdue(function(error, over_due) { if(error) { var err = new Error("Ooops"); @@ -61,7 +60,7 @@ RentalsController = { } else { res.json(over_due) } - }) + }); } } diff --git a/db/seeds/rentals.json b/db/seeds/rentals.json index 4a3e59de5..f97e7fe48 100644 --- a/db/seeds/rentals.json +++ b/db/seeds/rentals.json @@ -11,7 +11,7 @@ "movie_id": 2, "customer_id": 5, "created_date": "1960-06-16", -"due_date": "2016-06-28", +"due_date": "2016-06-18", "returned": false }, { diff --git a/models/rentals_model.js b/models/rentals_model.js index 77f6f16e7..137b23362 100644 --- a/models/rentals_model.js +++ b/models/rentals_model.js @@ -53,14 +53,44 @@ Rental.getCustomers = function(movie_title, callback) { } Rental.getOverdue = function(callback) { - var now = new Date().toISOString().split('T')[0]; - db.rentals.where("returned=$1 AND due_date<$2", [false, now], function(error, overdue) { - if(error) { + var now = new Date(); + console.log(now) + db.run("SELECT * FROM rentals WHERE returned=false AND due_date Date: Tue, 21 Jun 2016 15:58:35 -0700 Subject: [PATCH 40/69] getOverdue function. --- controllers/rentals.js | 2 +- db/seeds/rentals.json | 19 +++++++++++++------ models/rentals_model.js | 27 ++++++++++++++++----------- 3 files changed, 30 insertions(+), 18 deletions(-) diff --git a/controllers/rentals.js b/controllers/rentals.js index a4c34c465..138350810 100644 --- a/controllers/rentals.js +++ b/controllers/rentals.js @@ -48,7 +48,7 @@ RentalsController = { } else { res.json(returned) } - }); + }); }, diff --git a/db/seeds/rentals.json b/db/seeds/rentals.json index f97e7fe48..14891f4d9 100644 --- a/db/seeds/rentals.json +++ b/db/seeds/rentals.json @@ -1,17 +1,17 @@ -[ +[ { "movie_id": 2, "customer_id": 5, "created_date": "1980-06-16", "due_date": "1980-06-18", "returned": true, -"returned_date": "1980-06-18" +"returned_date": "1980-06-18T20:24:01.218Z" }, { "movie_id": 2, "customer_id": 5, "created_date": "1960-06-16", -"due_date": "2016-06-18", +"due_date": "2016-06-18T20:24:01.218Z", "returned": false }, { @@ -20,7 +20,7 @@ "created_date": "1960-06-16", "due_date": "1960-06-18", "returned": true, -"returned_date": "1960-06-18" +"returned_date": "1960-06-18T20:24:01.218Z" }, { "movie_id": 2, @@ -28,8 +28,15 @@ "created_date": "1970-06-16", "due_date": "1970-06-18", "returned": true, -"returned_date": "1967-06-18" +"returned_date": "1967-06-18T20:24:01.218Z" +}, +{ +"movie_id": 10, +"customer_id": 4, +"created_date": "1960-06-16", +"due_date": "1960-06-17", +"returned": false } -] \ No newline at end of file +] diff --git a/models/rentals_model.js b/models/rentals_model.js index 137b23362..2f258b788 100644 --- a/models/rentals_model.js +++ b/models/rentals_model.js @@ -53,22 +53,27 @@ Rental.getCustomers = function(movie_title, callback) { } Rental.getOverdue = function(callback) { - var now = new Date(); - console.log(now) - db.run("SELECT * FROM rentals WHERE returned=false AND due_date Date: Tue, 21 Jun 2016 16:04:16 -0700 Subject: [PATCH 41/69] finished getoverdue with innerjoin query --- models/rentals_model.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/models/rentals_model.js b/models/rentals_model.js index 2f258b788..c1e3f4c0a 100644 --- a/models/rentals_model.js +++ b/models/rentals_model.js @@ -54,25 +54,25 @@ Rental.getCustomers = function(movie_title, callback) { Rental.getOverdue = function(callback) { var now = new Date() - db.run("SELECT movie_id, customer_id, created_date, due_date FROM rentals WHERE returned=false AND due_date< $1", [now], function (error, overdues) { + db.run("SELECT customers.name, movies.title, rentals.created_date, rentals.due_date FROM rentals INNER JOIN movies ON movies.id=rentals.movie_id INNER JOIN customers ON customers.id=rentals.customer_id WHERE rentals.returned=false AND rentals.due_date<$1", [now], function (error, overdues) { if (error) { callback(error, undefined); } callback(null, overdues); - for (var rental in overdues) { - db.run("SELECT name FROM customers WHERE id=$1;", [rental.customer_id], function (error, customer_name, overdues) { - if (error) { - return callback(error); - } else { - rental["name"] = customer_name; - console.log(rental) - console.log(overdues) - } + // for (var rental in overdues) { + // db.run("SELECT name FROM customers WHERE id=$1;", [rental.customer_id], function (error, customer_name, overdues) { + // if (error) { + // return callback(error); + // } else { + // rental["name"] = customer_name; + // console.log(rental) + // console.log(overdues) + // } - }) - } + // }) + // } // )} // // set date vars // var now = new Date(); From 101632c05472f77791536a73b5c5247fc43ba640 Mon Sep 17 00:00:00 2001 From: Leah Date: Tue, 21 Jun 2016 21:50:01 -0700 Subject: [PATCH 42/69] got rentals/:title returning title, overview, release date, total inventory and available copies --- controllers/rentals.js | 14 +++++++++++--- models/movies_model.js | 4 +++- models/rentals_model.js | 16 ++++++++++++++++ 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/controllers/rentals.js b/controllers/rentals.js index 138350810..1ee7db439 100644 --- a/controllers/rentals.js +++ b/controllers/rentals.js @@ -8,10 +8,18 @@ RentalsController = { var err = new Error("No such movie"); err.status = 404; } else { - Rental.getCheckedOut(movie.id, function(error, checked_out) { + // console.log(movie.id) + Rental.getCurrentlyCheckedOut(movie, function(error, checked_out) { // get checkout int and minus from inventory (from movie instance) - console.log(checked_out) - res.json(checked_out) + // console.log((parseInt(movie.inventory))-(parseInt(checked_out))) + var return_data = { + title:movie.title, + overview:movie.overview, + release_date:movie.release_date, + total_inventory:movie.inventory, + available_copies:(parseInt(movie.inventory))-(parseInt(checked_out)) + } + res.json(return_data) }) } diff --git a/models/movies_model.js b/models/movies_model.js index 5b0e40b75..792099d11 100644 --- a/models/movies_model.js +++ b/models/movies_model.js @@ -25,7 +25,9 @@ Movie.findMovie = function(title, callback) { callback(error || new Error("Movie not found"), undefined); } else { - callback(null, new Movie(movie.title, movie.inventory)); + // callback(null, new Movie(movie.title, movie.inventory)); + // console.log(movie) + callback(null, movie) } }) }; diff --git a/models/rentals_model.js b/models/rentals_model.js index c1e3f4c0a..402a32124 100644 --- a/models/rentals_model.js +++ b/models/rentals_model.js @@ -32,6 +32,22 @@ Rental.getCurrentRentals = function(customer_id, callback) { }) } +Rental.getCurrentlyCheckedOut = function(movie, callback) { + // db.run("SELECT COUNT(*) FROM rentals WHERE returned=false AND movie_id=$1", [movie.id], function(error, checked_out) { + db.rentals.count({movie_id: movie.id, returned: false}, function (error, count) { + if(error) { + callback(error); + } else { + // console.log(movie) + // console.log(count); + // var available_copies = movie.inventory - checked_out + // console.log("poooooo") + // console.log(movie.inventory) + callback(null, count); + } + }) +} + Rental.getPastRentals = function(customer_id, callback) { db.run("SELECT customer_id, created_date, movie_id, returned_date FROM rentals WHERE customer_id=$1 AND returned=$2 ORDER BY returned_date ASC", [customer_id, true], function(error, past_rentals) { if(error) { From 25c80863bc14f78881603a68a4ced520127c0138 Mon Sep 17 00:00:00 2001 From: Leah Date: Tue, 21 Jun 2016 21:54:19 -0700 Subject: [PATCH 43/69] cleaned up commented out code and whitespace --- controllers/rentals.js | 3 --- models/movies_model.js | 7 ------- models/rentals_model.js | 43 ----------------------------------------- 3 files changed, 53 deletions(-) diff --git a/controllers/rentals.js b/controllers/rentals.js index 1ee7db439..f199008e5 100644 --- a/controllers/rentals.js +++ b/controllers/rentals.js @@ -8,10 +8,7 @@ RentalsController = { var err = new Error("No such movie"); err.status = 404; } else { - // console.log(movie.id) Rental.getCurrentlyCheckedOut(movie, function(error, checked_out) { - // get checkout int and minus from inventory (from movie instance) - // console.log((parseInt(movie.inventory))-(parseInt(checked_out))) var return_data = { title:movie.title, overview:movie.overview, diff --git a/models/movies_model.js b/models/movies_model.js index 792099d11..0e14d81e7 100644 --- a/models/movies_model.js +++ b/models/movies_model.js @@ -25,8 +25,6 @@ Movie.findMovie = function(title, callback) { callback(error || new Error("Movie not found"), undefined); } else { - // callback(null, new Movie(movie.title, movie.inventory)); - // console.log(movie) callback(null, movie) } }) @@ -49,9 +47,4 @@ Movie.sort = function(column, p, n, callback) { }) } - - - - - module.exports = Movie; diff --git a/models/rentals_model.js b/models/rentals_model.js index 402a32124..037eb740a 100644 --- a/models/rentals_model.js +++ b/models/rentals_model.js @@ -12,7 +12,6 @@ var Rental = function(movie_id, customer_id, created_date, due_date, returned = }; Rental.getCheckedOut = function(title, callback) { - // Not sure if this would return in an array or if we'd have to convert it to an array db.rentals.where("title=$1 AND returned=$2", [title, false], function(error, checked_out) { if(error) { callback(error, undefined); @@ -33,16 +32,10 @@ Rental.getCurrentRentals = function(customer_id, callback) { } Rental.getCurrentlyCheckedOut = function(movie, callback) { - // db.run("SELECT COUNT(*) FROM rentals WHERE returned=false AND movie_id=$1", [movie.id], function(error, checked_out) { db.rentals.count({movie_id: movie.id, returned: false}, function (error, count) { if(error) { callback(error); } else { - // console.log(movie) - // console.log(count); - // var available_copies = movie.inventory - checked_out - // console.log("poooooo") - // console.log(movie.inventory) callback(null, count); } }) @@ -75,42 +68,6 @@ Rental.getOverdue = function(callback) { callback(error, undefined); } callback(null, overdues); - - - // for (var rental in overdues) { - // db.run("SELECT name FROM customers WHERE id=$1;", [rental.customer_id], function (error, customer_name, overdues) { - // if (error) { - // return callback(error); - // } else { - // rental["name"] = customer_name; - // console.log(rental) - // console.log(overdues) - // } - - // }) - // } - // )} - // // set date vars - // var now = new Date(); - // var due = new Date(now); - // due.setDate(due.getDate() + 7); - - // // save new rental (nested inside find) - // db.rentals.save({ - // movie_id: movie_id.id, - // customer_id: id, - // created_date: now, - // due_date: due, - // returned: false - // // callback with rental info - // }, function (error, rental) { - // if (error) { - // return callback(error); - // } - // // pass rental back to controller - // return callback(null, rental); - // }); - // }); }); } From 35e9995d860a6ccd88987cf6e1808484008519d0 Mon Sep 17 00:00:00 2001 From: Leah Date: Wed, 22 Jun 2016 09:56:27 -0700 Subject: [PATCH 44/69] trying to setup test env everything is broken --- app.js | 3 +- package.json | 4 ++- spec/controllers/customers.spec.js | 16 ++++++++++ spec/controllers/movies.spec.js | 15 ++++++++-- spec/controllers/rentals.spec.js | 16 ++++++++++ spec/models/customers_model.spec.js | 45 +++++++++++++++++++++++++++++ spec/models/movies_model.spec.js | 45 +++++++++++++++++++++++++++++ spec/models/rentals_model.spec.js | 45 +++++++++++++++++++++++++++++ 8 files changed, 185 insertions(+), 4 deletions(-) create mode 100644 spec/controllers/customers.spec.js create mode 100644 spec/controllers/rentals.spec.js create mode 100644 spec/models/customers_model.spec.js create mode 100644 spec/models/movies_model.spec.js create mode 100644 spec/models/rentals_model.spec.js diff --git a/app.js b/app.js index de44c805a..4311e76c6 100644 --- a/app.js +++ b/app.js @@ -7,7 +7,8 @@ var bodyParser = require('body-parser'); var massive = require("massive"); var app = module.exports = express(); // -var connectionString = "postgres://localhost/video_store" +// var connectionString = "postgres://localhost/video_store" +var connectionString = "postgres://localhost/video_store" + app.get('env'); // connect to Massive and get the db instance. You can safely use the // convenience sync method here because its on app load diff --git a/package.json b/package.json index 6e664e2c8..a7f19b26e 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "private": true, "scripts": { "start": "nodemon ./bin/www", - "test": "clear; istanbul cover --include-all-sources jasmine-node --verbose spec/", + "start-test": "NODE_ENV=test ./node_modules/.bin/nodemon ./bin/www", + "test": "clear; ./node_modules/.bin/jasmine-node --captureExceptions --verbose spec/", "db:drop": "dropdb video_store", "db:create": "createdb video_store", "db:schema": "node tasks/load_schema.js", @@ -24,6 +25,7 @@ "devDependencies": { "istanbul": "^0.4.4", "jasmine-node": "^1.14.5", + "massive": "^2.3.0", "nodemon": "^1.9.2", "request": "^2.72.0" } diff --git a/spec/controllers/customers.spec.js b/spec/controllers/customers.spec.js new file mode 100644 index 000000000..81cfb3d29 --- /dev/null +++ b/spec/controllers/customers.spec.js @@ -0,0 +1,16 @@ +var request = require('request'); +var base_url = "http://localhost:3000/" +var route = "customers/" +// var app = require('../../app.js'); + +describe("Endpoints under /customers", function() { + it('responds with a 200 status code', function (done) { + request.get(base_url + route, function(error, response, body) { + expect(response.statusCode).toEqual(200) + done() + }) + }); + + + +}); \ No newline at end of file diff --git a/spec/controllers/movies.spec.js b/spec/controllers/movies.spec.js index ddcaf2f68..ea32257f1 100644 --- a/spec/controllers/movies.spec.js +++ b/spec/controllers/movies.spec.js @@ -1,5 +1,16 @@ var request = require('request'); +var base_url = "http://localhost:3000/" +var route = "movies/" + describe("Endpoints under /movies", function() { - -}) + it('responds with a 200 status code', function (done) { + request.get(base_url + route, function(error, response, body) { + expect(response.statusCode).toEqual(200) + done() + }) + }); + + + +}); \ No newline at end of file diff --git a/spec/controllers/rentals.spec.js b/spec/controllers/rentals.spec.js new file mode 100644 index 000000000..52785c5e4 --- /dev/null +++ b/spec/controllers/rentals.spec.js @@ -0,0 +1,16 @@ +var request = require('request'); +var base_url = "http://localhost:3000/" +var route = "rentals/" + + +describe("Endpoints under /rentals", function() { + it('responds with a 200 status code', function (done) { + request.get(base_url + route, function(error, response, body) { + expect(response.statusCode).toEqual(200) + done() + }) + }); + + + +}); \ No newline at end of file diff --git a/spec/models/customers_model.spec.js b/spec/models/customers_model.spec.js new file mode 100644 index 000000000..8b2362d5f --- /dev/null +++ b/spec/models/customers_model.spec.js @@ -0,0 +1,45 @@ +var app = require("../../app"); +var db = app.get("db"); + +var Account = require('../../models/customers_model') + + +// below are tests from in class demo + +// describe('Account', function () { +// var account1, account2 +// var initialBalance1 = 100.0 +// var initialBalance2 = 0 + +// beforeEach(function (done) { +// Account.create(initialBalance1, function(err, account) { +// account1 = account +// done() +// }) +// }) + +// afterEach(function () { +// // delete all the accounts I created + +// db.end() +// // Account.close_connection() +// }) + +// describe('#getBalance', function () { +// it('should return positive balances', function (done) { +// account1.getBalance(function (error, balance) { +// expect(error).toBeNull +// expect(balance).toEqual('$100.00') +// done() +// }) +// }) + +// it('should not break, I guess', function (done) { +// account1.getBalance(function (error, balance) { +// expect(error).toBeNull +// expect(balance).toEqual('$100.00') +// done() +// }) +// }) +// }) +// }) diff --git a/spec/models/movies_model.spec.js b/spec/models/movies_model.spec.js new file mode 100644 index 000000000..22a5fb3e1 --- /dev/null +++ b/spec/models/movies_model.spec.js @@ -0,0 +1,45 @@ +var app = require("../../app"); +var db = app.get("db"); + +var Account = require('../../models/movies_model') + + +// below are tests from in class demo + +// describe('Account', function () { +// var account1, account2 +// var initialBalance1 = 100.0 +// var initialBalance2 = 0 + +// beforeEach(function (done) { +// Account.create(initialBalance1, function(err, account) { +// account1 = account +// done() +// }) +// }) + +// afterEach(function () { +// // delete all the accounts I created + +// db.end() +// // Account.close_connection() +// }) + +// describe('#getBalance', function () { +// it('should return positive balances', function (done) { +// account1.getBalance(function (error, balance) { +// expect(error).toBeNull +// expect(balance).toEqual('$100.00') +// done() +// }) +// }) + +// it('should not break, I guess', function (done) { +// account1.getBalance(function (error, balance) { +// expect(error).toBeNull +// expect(balance).toEqual('$100.00') +// done() +// }) +// }) +// }) +// }) diff --git a/spec/models/rentals_model.spec.js b/spec/models/rentals_model.spec.js new file mode 100644 index 000000000..b330b2f41 --- /dev/null +++ b/spec/models/rentals_model.spec.js @@ -0,0 +1,45 @@ +var app = require("../../app"); +var db = app.get("db"); + +var Account = require('../../models/rentals_model') + + +// below are tests from in class demo + +// describe('Account', function () { +// var account1, account2 +// var initialBalance1 = 100.0 +// var initialBalance2 = 0 + +// beforeEach(function (done) { +// Account.create(initialBalance1, function(err, account) { +// account1 = account +// done() +// }) +// }) + +// afterEach(function () { +// // delete all the accounts I created + +// db.end() +// // Account.close_connection() +// }) + +// describe('#getBalance', function () { +// it('should return positive balances', function (done) { +// account1.getBalance(function (error, balance) { +// expect(error).toBeNull +// expect(balance).toEqual('$100.00') +// done() +// }) +// }) + +// it('should not break, I guess', function (done) { +// account1.getBalance(function (error, balance) { +// expect(error).toBeNull +// expect(balance).toEqual('$100.00') +// done() +// }) +// }) +// }) +// }) From 59b985ee1f7561a49e876c97734abf3c3a60e212 Mon Sep 17 00:00:00 2001 From: Leah Date: Wed, 22 Jun 2016 10:40:01 -0700 Subject: [PATCH 45/69] got test env config, can run npm run reset-test to create, schema, seed test db to use for testing, then npm start-test and npm run test --- package.json | 15 ++++++---- spec/controllers/index.spec.js | 48 ++++++++++++++++---------------- spec/controllers/movies.spec.js | 16 +++++------ spec/controllers/rentals.spec.js | 16 +++++------ tasks/load_schema.js | 5 ++-- tasks/seed.js | 6 ++-- 6 files changed, 57 insertions(+), 49 deletions(-) diff --git a/package.json b/package.json index a7f19b26e..3fc3b71f0 100644 --- a/package.json +++ b/package.json @@ -4,13 +4,18 @@ "private": true, "scripts": { "start": "nodemon ./bin/www", - "start-test": "NODE_ENV=test ./node_modules/.bin/nodemon ./bin/www", - "test": "clear; ./node_modules/.bin/jasmine-node --captureExceptions --verbose spec/", "db:drop": "dropdb video_store", "db:create": "createdb video_store", - "db:schema": "node tasks/load_schema.js", - "db:seed": "node tasks/seed.js", - "reset": "npm run db:drop; npm run db:create; npm run db:schema; npm run db:seed;" + "db:schema": "node tasks/load_schema.js video_store", + "db:seed": "node tasks/seed.js video_store", + "reset": "npm run db:drop; npm run db:create; npm run db:schema; npm run db:seed;", + "start-test": "NODE_ENV=test ./node_modules/.bin/nodemon ./bin/www", + "db:drop-test": "dropdb video_storetest", + "db:create-test": "createdb video_storetest", + "db:schema-test": "node tasks/load_schema.js video_storetest", + "db:seed-test": "node tasks/seed.js video_storetest", + "reset-test": "npm run db:drop-test; npm run db:create-test; npm run db:schema-test; npm run db:seed-test;", + "test": "clear; ./node_modules/.bin/jasmine-node --captureExceptions --verbose spec/" }, "dependencies": { "body-parser": "~1.13.2", diff --git a/spec/controllers/index.spec.js b/spec/controllers/index.spec.js index e4151d267..697d553b1 100644 --- a/spec/controllers/index.spec.js +++ b/spec/controllers/index.spec.js @@ -1,29 +1,29 @@ var request = require('request') var base_url = "http://localhost:3000/" -describe("Endpoint at /", function () { - it('responds with a 200 status code', function (done) { - request.get(base_url, function(error, response, body) { - expect(response.statusCode).toEqual(200) - done() - }) - }) +// describe("Endpoint at /", function () { +// it('responds with a 200 status code', function (done) { +// request.get(base_url, function(error, response, body) { +// expect(response.statusCode).toEqual(200) +// done() +// }) +// }) - describe("the returned json data", function() { - it('has the right keys', function(done) { - request.get(base_url, function(error, response, body) { - var data = JSON.parse(body) - expect(Object.keys(data)).toEqual(['whatevs']) - done() - }) - }) +// describe("the returned json data", function() { +// it('has the right keys', function(done) { +// request.get(base_url, function(error, response, body) { +// var data = JSON.parse(body) +// expect(Object.keys(data)).toEqual(['whatevs']) +// done() +// }) +// }) - it('has the right values for the keys', function(done) { - request.get(base_url, function(error, response, body) { - var data = JSON.parse(body) - expect(data.whatevs).toEqual('whatevs!!!') - done() - }) - }) - }) -}) +// it('has the right values for the keys', function(done) { +// request.get(base_url, function(error, response, body) { +// var data = JSON.parse(body) +// expect(data.whatevs).toEqual('whatevs!!!') +// done() +// }) +// }) +// }) +// }) diff --git a/spec/controllers/movies.spec.js b/spec/controllers/movies.spec.js index ea32257f1..a4fbf0be2 100644 --- a/spec/controllers/movies.spec.js +++ b/spec/controllers/movies.spec.js @@ -3,14 +3,14 @@ var base_url = "http://localhost:3000/" var route = "movies/" -describe("Endpoints under /movies", function() { - it('responds with a 200 status code', function (done) { - request.get(base_url + route, function(error, response, body) { - expect(response.statusCode).toEqual(200) - done() - }) - }); +// describe("Endpoints under /movies", function() { +// it('responds with a 200 status code', function (done) { +// request.get(base_url + route, function(error, response, body) { +// expect(response.statusCode).toEqual(200) +// done() +// }) +// }); -}); \ No newline at end of file +// }); \ No newline at end of file diff --git a/spec/controllers/rentals.spec.js b/spec/controllers/rentals.spec.js index 52785c5e4..d550ac692 100644 --- a/spec/controllers/rentals.spec.js +++ b/spec/controllers/rentals.spec.js @@ -3,14 +3,14 @@ var base_url = "http://localhost:3000/" var route = "rentals/" -describe("Endpoints under /rentals", function() { - it('responds with a 200 status code', function (done) { - request.get(base_url + route, function(error, response, body) { - expect(response.statusCode).toEqual(200) - done() - }) - }); +// describe("Endpoints under /rentals", function() { +// it('responds with a 200 status code', function (done) { +// request.get(base_url + route, function(error, response, body) { +// expect(response.statusCode).toEqual(200) +// done() +// }) +// }); -}); \ No newline at end of file +// }); \ No newline at end of file diff --git a/tasks/load_schema.js b/tasks/load_schema.js index 4eefac1a6..801e8b655 100644 --- a/tasks/load_schema.js +++ b/tasks/load_schema.js @@ -1,7 +1,8 @@ var massive = require('massive') -var connectionString = "postgres://localhost/video_store" -var db = massive.connectSync({connectionString : connectionString}) +var databaseName = process.argv[2]; +var connectionString = "postgres://localhost/" + databaseName; +var db = massive.connectSync({connectionString : connectionString}); db.setup.schema([], function(err, res) { if (err) { diff --git a/tasks/seed.js b/tasks/seed.js index df307ee82..8513ee0a2 100644 --- a/tasks/seed.js +++ b/tasks/seed.js @@ -1,6 +1,8 @@ var massive = require('massive') -var connectionString = "postgres://localhost/video_store" -var db = massive.connectSync({connectionString : connectionString}) + +var databaseName = process.argv[2]; +var connectionString = "postgres://localhost/" + databaseName; +var db = massive.connectSync({connectionString : connectionString}); // produces array with each element is an object key:value pair var moviesParsedJSON = require('../db/seeds/movies.json'); From c1807497d5fd3719ee0dafb08a1f788c16a4311a Mon Sep 17 00:00:00 2001 From: Leah Date: Wed, 22 Jun 2016 10:54:36 -0700 Subject: [PATCH 46/69] changed dev db to be named _development --- app.js | 2 +- package.json | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app.js b/app.js index 4311e76c6..f8590815b 100644 --- a/app.js +++ b/app.js @@ -8,7 +8,7 @@ var massive = require("massive"); var app = module.exports = express(); // // var connectionString = "postgres://localhost/video_store" -var connectionString = "postgres://localhost/video_store" + app.get('env'); +var connectionString = "postgres://localhost/video_store_" + app.get('env'); // connect to Massive and get the db instance. You can safely use the // convenience sync method here because its on app load diff --git a/package.json b/package.json index 3fc3b71f0..75917ce6b 100644 --- a/package.json +++ b/package.json @@ -4,16 +4,16 @@ "private": true, "scripts": { "start": "nodemon ./bin/www", - "db:drop": "dropdb video_store", - "db:create": "createdb video_store", - "db:schema": "node tasks/load_schema.js video_store", - "db:seed": "node tasks/seed.js video_store", + "db:drop": "dropdb video_store_development", + "db:create": "createdb video_store_development", + "db:schema": "node tasks/load_schema.js video_store_development", + "db:seed": "node tasks/seed.js video_store_development", "reset": "npm run db:drop; npm run db:create; npm run db:schema; npm run db:seed;", "start-test": "NODE_ENV=test ./node_modules/.bin/nodemon ./bin/www", - "db:drop-test": "dropdb video_storetest", - "db:create-test": "createdb video_storetest", - "db:schema-test": "node tasks/load_schema.js video_storetest", - "db:seed-test": "node tasks/seed.js video_storetest", + "db:drop-test": "dropdb video_store_test", + "db:create-test": "createdb video_store_test", + "db:schema-test": "node tasks/load_schema.js video_store_test", + "db:seed-test": "node tasks/seed.js video_store_test", "reset-test": "npm run db:drop-test; npm run db:create-test; npm run db:schema-test; npm run db:seed-test;", "test": "clear; ./node_modules/.bin/jasmine-node --captureExceptions --verbose spec/" }, From f55f4d0a06696f5f6dd9adefb0ee684ffecaab3d Mon Sep 17 00:00:00 2001 From: Alysia Brown Date: Wed, 22 Jun 2016 13:49:12 -0700 Subject: [PATCH 47/69] Added basic customer controller tests. --- spec/controllers/customers.spec.js | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/spec/controllers/customers.spec.js b/spec/controllers/customers.spec.js index 81cfb3d29..ef4fc5ec5 100644 --- a/spec/controllers/customers.spec.js +++ b/spec/controllers/customers.spec.js @@ -4,6 +4,7 @@ var route = "customers/" // var app = require('../../app.js'); describe("Endpoints under /customers", function() { + it('responds with a 200 status code', function (done) { request.get(base_url + route, function(error, response, body) { expect(response.statusCode).toEqual(200) @@ -11,6 +12,26 @@ describe("Endpoints under /customers", function() { }) }); + it("should be json", function(done) { + request.get(base_url + route, function(error, response, body) { + expect(response.headers['content-type']).toContain('application/json') + done() + }) + }); + + it("should be an array of objects", function(done) { + request.get(base_url + route, function(error, response, body) { + var data = JSON.parse(body) + expect(typeof data).toEqual('object') + + for (var record of data) { + expect(Object.keys(record)).toEqual(['id']) + } + + done() + }) + }); + -}); \ No newline at end of file +}); From 8983dfefd055a0c08415baf38244b918379c5e8b Mon Sep 17 00:00:00 2001 From: Leah Date: Thu, 23 Jun 2016 09:19:28 -0700 Subject: [PATCH 48/69] changed run test command, added tests to movies and rentals controllers --- coverage/coverage.json | 1 + .../lcov-report/VideoStoreAPI/app.js.html | 308 ++++++++++ .../controllers/customers.js.html | 221 +++++++ .../VideoStoreAPI/controllers/index.html | 119 ++++ .../VideoStoreAPI/controllers/movies.js.html | 200 +++++++ .../VideoStoreAPI/controllers/rentals.js.html | 281 +++++++++ coverage/lcov-report/VideoStoreAPI/index.html | 93 +++ .../models/customers_model.js.html | 176 ++++++ .../VideoStoreAPI/models/index.html | 119 ++++ .../VideoStoreAPI/models/movies_model.js.html | 215 +++++++ .../models/rentals_model.js.html | 455 ++++++++++++++ .../VideoStoreAPI/routes/customers.js.html | 101 ++++ .../VideoStoreAPI/routes/index.html | 132 +++++ .../VideoStoreAPI/routes/index.js.html | 107 ++++ .../VideoStoreAPI/routes/movies.js.html | 101 ++++ .../VideoStoreAPI/routes/rentals.js.html | 116 ++++ coverage/lcov-report/base.css | 213 +++++++ coverage/lcov-report/index.html | 132 +++++ coverage/lcov-report/prettify.css | 1 + coverage/lcov-report/prettify.js | 1 + coverage/lcov-report/sort-arrow-sprite.png | Bin 0 -> 209 bytes coverage/lcov-report/sorter.js | 158 +++++ coverage/lcov.info | 559 ++++++++++++++++++ package.json | 2 +- spec/controllers/customers.spec.js | 1 - spec/controllers/index.spec.js | 34 +- spec/controllers/movies.spec.js | 19 +- spec/controllers/rentals.spec.js | 19 +- spec/models/customers_model.spec.js | 1 - spec/models/movies_model.spec.js | 1 - spec/models/rentals_model.spec.js | 1 - 31 files changed, 3834 insertions(+), 53 deletions(-) create mode 100644 coverage/coverage.json create mode 100644 coverage/lcov-report/VideoStoreAPI/app.js.html create mode 100644 coverage/lcov-report/VideoStoreAPI/controllers/customers.js.html create mode 100644 coverage/lcov-report/VideoStoreAPI/controllers/index.html create mode 100644 coverage/lcov-report/VideoStoreAPI/controllers/movies.js.html create mode 100644 coverage/lcov-report/VideoStoreAPI/controllers/rentals.js.html create mode 100644 coverage/lcov-report/VideoStoreAPI/index.html create mode 100644 coverage/lcov-report/VideoStoreAPI/models/customers_model.js.html create mode 100644 coverage/lcov-report/VideoStoreAPI/models/index.html create mode 100644 coverage/lcov-report/VideoStoreAPI/models/movies_model.js.html create mode 100644 coverage/lcov-report/VideoStoreAPI/models/rentals_model.js.html create mode 100644 coverage/lcov-report/VideoStoreAPI/routes/customers.js.html create mode 100644 coverage/lcov-report/VideoStoreAPI/routes/index.html create mode 100644 coverage/lcov-report/VideoStoreAPI/routes/index.js.html create mode 100644 coverage/lcov-report/VideoStoreAPI/routes/movies.js.html create mode 100644 coverage/lcov-report/VideoStoreAPI/routes/rentals.js.html create mode 100644 coverage/lcov-report/base.css create mode 100644 coverage/lcov-report/index.html create mode 100644 coverage/lcov-report/prettify.css create mode 100644 coverage/lcov-report/prettify.js create mode 100644 coverage/lcov-report/sort-arrow-sprite.png create mode 100644 coverage/lcov-report/sorter.js create mode 100644 coverage/lcov.info diff --git a/coverage/coverage.json b/coverage/coverage.json new file mode 100644 index 000000000..89e407e35 --- /dev/null +++ b/coverage/coverage.json @@ -0,0 +1 @@ +{"/Users/leahpetersen/C5/projects/VideoStoreAPI/app.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/app.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":1,"19":1,"20":1,"21":1,"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":0,"29":0,"30":0,"31":1,"32":0,"33":0,"34":0,"35":1,"36":0,"37":0,"38":1},"b":{"1":[0,1],"2":[0,0],"3":[0,0]},"f":{"1":0,"2":0,"3":0},"fnMap":{"1":{"name":"(anonymous_1)","line":50,"loc":{"start":{"line":50,"column":8},"end":{"line":50,"column":33}}},"2":{"name":"(anonymous_2)","line":61,"loc":{"start":{"line":61,"column":10},"end":{"line":61,"column":40}}},"3":{"name":"(anonymous_3)","line":72,"loc":{"start":{"line":72,"column":8},"end":{"line":72,"column":38}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":27}},"3":{"start":{"line":3,"column":0},"end":{"line":3,"column":39}},"4":{"start":{"line":4,"column":0},"end":{"line":4,"column":31}},"5":{"start":{"line":5,"column":0},"end":{"line":5,"column":44}},"6":{"start":{"line":6,"column":0},"end":{"line":6,"column":40}},"7":{"start":{"line":7,"column":0},"end":{"line":7,"column":33}},"8":{"start":{"line":8,"column":0},"end":{"line":8,"column":37}},"9":{"start":{"line":11,"column":0},"end":{"line":11,"column":76}},"10":{"start":{"line":16,"column":0},"end":{"line":16,"column":80}},"11":{"start":{"line":19,"column":0},"end":{"line":19,"column":31}},"12":{"start":{"line":23,"column":0},"end":{"line":23,"column":48}},"13":{"start":{"line":24,"column":0},"end":{"line":24,"column":31}},"14":{"start":{"line":28,"column":0},"end":{"line":28,"column":23}},"15":{"start":{"line":31,"column":0},"end":{"line":31,"column":27}},"16":{"start":{"line":32,"column":0},"end":{"line":32,"column":52}},"17":{"start":{"line":33,"column":0},"end":{"line":33,"column":24}},"18":{"start":{"line":34,"column":0},"end":{"line":34,"column":56}},"19":{"start":{"line":36,"column":0},"end":{"line":36,"column":42}},"20":{"start":{"line":37,"column":0},"end":{"line":37,"column":46}},"21":{"start":{"line":38,"column":0},"end":{"line":38,"column":43}},"22":{"start":{"line":39,"column":0},"end":{"line":39,"column":44}},"23":{"start":{"line":43,"column":0},"end":{"line":43,"column":21}},"24":{"start":{"line":44,"column":0},"end":{"line":44,"column":33}},"25":{"start":{"line":45,"column":0},"end":{"line":45,"column":27}},"26":{"start":{"line":46,"column":0},"end":{"line":46,"column":29}},"27":{"start":{"line":50,"column":0},"end":{"line":54,"column":3}},"28":{"start":{"line":51,"column":2},"end":{"line":51,"column":35}},"29":{"start":{"line":52,"column":2},"end":{"line":52,"column":19}},"30":{"start":{"line":53,"column":2},"end":{"line":53,"column":12}},"31":{"start":{"line":60,"column":0},"end":{"line":68,"column":1}},"32":{"start":{"line":61,"column":2},"end":{"line":67,"column":5}},"33":{"start":{"line":62,"column":4},"end":{"line":62,"column":34}},"34":{"start":{"line":63,"column":4},"end":{"line":66,"column":7}},"35":{"start":{"line":72,"column":0},"end":{"line":78,"column":3}},"36":{"start":{"line":73,"column":2},"end":{"line":73,"column":32}},"37":{"start":{"line":74,"column":2},"end":{"line":77,"column":5}},"38":{"start":{"line":81,"column":0},"end":{"line":81,"column":21}}},"branchMap":{"1":{"line":60,"type":"if","locations":[{"start":{"line":60,"column":0},"end":{"line":60,"column":0}},{"start":{"line":60,"column":0},"end":{"line":60,"column":0}}]},"2":{"line":62,"type":"binary-expr","locations":[{"start":{"line":62,"column":15},"end":{"line":62,"column":25}},{"start":{"line":62,"column":29},"end":{"line":62,"column":32}}]},"3":{"line":73,"type":"binary-expr","locations":[{"start":{"line":73,"column":13},"end":{"line":73,"column":23}},{"start":{"line":73,"column":27},"end":{"line":73,"column":30}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/index.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/index.js","s":{"1":1,"2":1,"3":1,"4":0,"5":1,"6":0,"7":1},"b":{},"f":{"1":0,"2":0},"fnMap":{"1":{"name":"(anonymous_1)","line":6,"loc":{"start":{"line":6,"column":16},"end":{"line":6,"column":41}}},"2":{"name":"(anonymous_2)","line":10,"loc":{"start":{"line":10,"column":20},"end":{"line":10,"column":45}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}},"3":{"start":{"line":6,"column":0},"end":{"line":8,"column":3}},"4":{"start":{"line":7,"column":2},"end":{"line":7,"column":40}},"5":{"start":{"line":10,"column":0},"end":{"line":12,"column":3}},"6":{"start":{"line":11,"column":2},"end":{"line":11,"column":49}},"7":{"start":{"line":14,"column":0},"end":{"line":14,"column":24}}},"branchMap":{}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/customers.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/customers.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1},"b":{},"f":{},"fnMap":{},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}},"3":{"start":{"line":3,"column":0},"end":{"line":3,"column":52}},"4":{"start":{"line":6,"column":0},"end":{"line":6,"column":40}},"5":{"start":{"line":7,"column":0},"end":{"line":7,"column":55}},"6":{"start":{"line":8,"column":0},"end":{"line":8,"column":67}},"7":{"start":{"line":9,"column":0},"end":{"line":9,"column":67}},"8":{"start":{"line":12,"column":0},"end":{"line":12,"column":24}}},"branchMap":{}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/customers.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/customers.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0},"fnMap":{"1":{"name":"(anonymous_1)","line":6,"loc":{"start":{"line":6,"column":15},"end":{"line":6,"column":34}}},"2":{"name":"(anonymous_2)","line":7,"loc":{"start":{"line":7,"column":15},"end":{"line":7,"column":42}}},"3":{"name":"(anonymous_3)","line":18,"loc":{"start":{"line":18,"column":18},"end":{"line":18,"column":37}}},"4":{"name":"(anonymous_4)","line":19,"loc":{"start":{"line":19,"column":61},"end":{"line":19,"column":83}}},"5":{"name":"(anonymous_5)","line":30,"loc":{"start":{"line":30,"column":22},"end":{"line":30,"column":41}}},"6":{"name":"(anonymous_6)","line":31,"loc":{"start":{"line":31,"column":51},"end":{"line":31,"column":73}}},"7":{"name":"(anonymous_7)","line":41,"loc":{"start":{"line":41,"column":22},"end":{"line":41,"column":41}}},"8":{"name":"(anonymous_8)","line":42,"loc":{"start":{"line":42,"column":48},"end":{"line":42,"column":70}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":48}},"3":{"start":{"line":5,"column":0},"end":{"line":51,"column":1}},"4":{"start":{"line":7,"column":2},"end":{"line":14,"column":4}},"5":{"start":{"line":8,"column":3},"end":{"line":13,"column":4}},"6":{"start":{"line":9,"column":4},"end":{"line":9,"column":76}},"7":{"start":{"line":10,"column":4},"end":{"line":10,"column":21}},"8":{"start":{"line":12,"column":4},"end":{"line":12,"column":23}},"9":{"start":{"line":19,"column":2},"end":{"line":26,"column":4}},"10":{"start":{"line":20,"column":3},"end":{"line":25,"column":4}},"11":{"start":{"line":21,"column":4},"end":{"line":21,"column":40}},"12":{"start":{"line":22,"column":4},"end":{"line":22,"column":21}},"13":{"start":{"line":24,"column":5},"end":{"line":24,"column":19}},"14":{"start":{"line":31,"column":2},"end":{"line":38,"column":4}},"15":{"start":{"line":32,"column":3},"end":{"line":37,"column":4}},"16":{"start":{"line":33,"column":4},"end":{"line":33,"column":40}},"17":{"start":{"line":34,"column":4},"end":{"line":34,"column":21}},"18":{"start":{"line":36,"column":5},"end":{"line":36,"column":19}},"19":{"start":{"line":42,"column":2},"end":{"line":49,"column":4}},"20":{"start":{"line":43,"column":3},"end":{"line":48,"column":4}},"21":{"start":{"line":44,"column":4},"end":{"line":44,"column":40}},"22":{"start":{"line":45,"column":4},"end":{"line":45,"column":21}},"23":{"start":{"line":47,"column":5},"end":{"line":47,"column":19}},"24":{"start":{"line":52,"column":0},"end":{"line":52,"column":36}}},"branchMap":{"1":{"line":8,"type":"if","locations":[{"start":{"line":8,"column":3},"end":{"line":8,"column":3}},{"start":{"line":8,"column":3},"end":{"line":8,"column":3}}]},"2":{"line":20,"type":"if","locations":[{"start":{"line":20,"column":3},"end":{"line":20,"column":3}},{"start":{"line":20,"column":3},"end":{"line":20,"column":3}}]},"3":{"line":32,"type":"if","locations":[{"start":{"line":32,"column":3},"end":{"line":32,"column":3}},{"start":{"line":32,"column":3},"end":{"line":32,"column":3}}]},"4":{"line":43,"type":"if","locations":[{"start":{"line":43,"column":3},"end":{"line":43,"column":3}},{"start":{"line":43,"column":3},"end":{"line":43,"column":3}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/customers_model.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/customers_model.js","s":{"1":1,"2":1,"3":1,"4":0,"5":1,"6":0,"7":0,"8":0,"9":0,"10":0,"11":1,"12":0,"13":0,"14":0,"15":0,"16":0,"17":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0},"fnMap":{"1":{"name":"(anonymous_1)","line":4,"loc":{"start":{"line":4,"column":15},"end":{"line":4,"column":28}}},"2":{"name":"(anonymous_2)","line":8,"loc":{"start":{"line":8,"column":15},"end":{"line":8,"column":34}}},"3":{"name":"(anonymous_3)","line":9,"loc":{"start":{"line":9,"column":20},"end":{"line":9,"column":47}}},"4":{"name":"(anonymous_4)","line":13,"loc":{"start":{"line":13,"column":35},"end":{"line":13,"column":54}}},"5":{"name":"(anonymous_5)","line":20,"loc":{"start":{"line":20,"column":16},"end":{"line":20,"column":49}}},"6":{"name":"(anonymous_6)","line":26,"loc":{"start":{"line":26,"column":5},"end":{"line":26,"column":32}}},"7":{"name":"(anonymous_7)","line":30,"loc":{"start":{"line":30,"column":36},"end":{"line":30,"column":56}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}},"3":{"start":{"line":4,"column":0},"end":{"line":6,"column":1}},"4":{"start":{"line":5,"column":2},"end":{"line":5,"column":15}},"5":{"start":{"line":8,"column":0},"end":{"line":18,"column":2}},"6":{"start":{"line":9,"column":2},"end":{"line":17,"column":4}},"7":{"start":{"line":10,"column":4},"end":{"line":16,"column":5}},"8":{"start":{"line":11,"column":6},"end":{"line":11,"column":78}},"9":{"start":{"line":13,"column":6},"end":{"line":15,"column":9}},"10":{"start":{"line":14,"column":8},"end":{"line":14,"column":41}},"11":{"start":{"line":20,"column":0},"end":{"line":35,"column":1}},"12":{"start":{"line":22,"column":1},"end":{"line":34,"column":4}},"13":{"start":{"line":27,"column":4},"end":{"line":33,"column":5}},"14":{"start":{"line":28,"column":6},"end":{"line":28,"column":77}},"15":{"start":{"line":30,"column":6},"end":{"line":32,"column":9}},"16":{"start":{"line":31,"column":8},"end":{"line":31,"column":23}},"17":{"start":{"line":37,"column":0},"end":{"line":37,"column":26}}},"branchMap":{"1":{"line":10,"type":"if","locations":[{"start":{"line":10,"column":4},"end":{"line":10,"column":4}},{"start":{"line":10,"column":4},"end":{"line":10,"column":4}}]},"2":{"line":10,"type":"binary-expr","locations":[{"start":{"line":10,"column":8},"end":{"line":10,"column":13}},{"start":{"line":10,"column":16},"end":{"line":10,"column":26}}]},"3":{"line":11,"type":"binary-expr","locations":[{"start":{"line":11,"column":15},"end":{"line":11,"column":20}},{"start":{"line":11,"column":24},"end":{"line":11,"column":65}}]},"4":{"line":27,"type":"if","locations":[{"start":{"line":27,"column":4},"end":{"line":27,"column":4}},{"start":{"line":27,"column":4},"end":{"line":27,"column":4}}]},"5":{"line":27,"type":"binary-expr","locations":[{"start":{"line":27,"column":8},"end":{"line":27,"column":13}},{"start":{"line":27,"column":17},"end":{"line":27,"column":27}}]},"6":{"line":28,"type":"binary-expr","locations":[{"start":{"line":28,"column":15},"end":{"line":28,"column":20}},{"start":{"line":28,"column":24},"end":{"line":28,"column":65}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/rentals_model.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/rentals_model.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":1,"11":0,"12":0,"13":0,"14":0,"15":1,"16":0,"17":0,"18":0,"19":0,"20":1,"21":0,"22":0,"23":0,"24":0,"25":1,"26":0,"27":0,"28":0,"29":0,"30":1,"31":0,"32":0,"33":0,"34":0,"35":1,"36":0,"37":0,"38":0,"39":0,"40":0,"41":1,"42":0,"43":0,"44":0,"45":0,"46":1,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0},"fnMap":{"1":{"name":"(anonymous_1)","line":4,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":109}}},"2":{"name":"(anonymous_2)","line":14,"loc":{"start":{"line":14,"column":23},"end":{"line":14,"column":49}}},"3":{"name":"(anonymous_3)","line":15,"loc":{"start":{"line":15,"column":63},"end":{"line":15,"column":92}}},"4":{"name":"(anonymous_4)","line":24,"loc":{"start":{"line":24,"column":27},"end":{"line":24,"column":59}}},"5":{"name":"(anonymous_5)","line":25,"loc":{"start":{"line":25,"column":75},"end":{"line":25,"column":104}}},"6":{"name":"(anonymous_6)","line":34,"loc":{"start":{"line":34,"column":32},"end":{"line":34,"column":58}}},"7":{"name":"(anonymous_7)","line":35,"loc":{"start":{"line":35,"column":58},"end":{"line":35,"column":82}}},"8":{"name":"(anonymous_8)","line":44,"loc":{"start":{"line":44,"column":24},"end":{"line":44,"column":56}}},"9":{"name":"(anonymous_9)","line":45,"loc":{"start":{"line":45,"column":168},"end":{"line":45,"column":198}}},"10":{"name":"(anonymous_10)","line":54,"loc":{"start":{"line":54,"column":22},"end":{"line":54,"column":54}}},"11":{"name":"(anonymous_11)","line":55,"loc":{"start":{"line":55,"column":167},"end":{"line":55,"column":194}}},"12":{"name":"(anonymous_12)","line":64,"loc":{"start":{"line":64,"column":20},"end":{"line":64,"column":39}}},"13":{"name":"(anonymous_13)","line":66,"loc":{"start":{"line":66,"column":266},"end":{"line":66,"column":293}}},"14":{"name":"(anonymous_14)","line":74,"loc":{"start":{"line":74,"column":19},"end":{"line":74,"column":49}}},"15":{"name":"(anonymous_15)","line":79,"loc":{"start":{"line":79,"column":7},"end":{"line":79,"column":36}}},"16":{"name":"(anonymous_16)","line":88,"loc":{"start":{"line":88,"column":21},"end":{"line":88,"column":57}}},"17":{"name":"(anonymous_17)","line":93,"loc":{"start":{"line":93,"column":5},"end":{"line":93,"column":29}}},"18":{"name":"(anonymous_18)","line":101,"loc":{"start":{"line":101,"column":90},"end":{"line":101,"column":149}}},"19":{"name":"(anonymous_19)","line":119,"loc":{"start":{"line":119,"column":9},"end":{"line":119,"column":34}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}},"3":{"start":{"line":4,"column":0},"end":{"line":12,"column":2}},"4":{"start":{"line":5,"column":2},"end":{"line":5,"column":27}},"5":{"start":{"line":6,"column":2},"end":{"line":6,"column":33}},"6":{"start":{"line":7,"column":2},"end":{"line":7,"column":35}},"7":{"start":{"line":8,"column":2},"end":{"line":8,"column":27}},"8":{"start":{"line":9,"column":2},"end":{"line":9,"column":27}},"9":{"start":{"line":10,"column":2},"end":{"line":10,"column":37}},"10":{"start":{"line":14,"column":0},"end":{"line":22,"column":1}},"11":{"start":{"line":15,"column":2},"end":{"line":21,"column":4}},"12":{"start":{"line":16,"column":4},"end":{"line":20,"column":5}},"13":{"start":{"line":17,"column":6},"end":{"line":17,"column":33}},"14":{"start":{"line":19,"column":6},"end":{"line":19,"column":34}},"15":{"start":{"line":24,"column":0},"end":{"line":32,"column":1}},"16":{"start":{"line":25,"column":2},"end":{"line":31,"column":4}},"17":{"start":{"line":26,"column":4},"end":{"line":30,"column":5}},"18":{"start":{"line":27,"column":6},"end":{"line":27,"column":33}},"19":{"start":{"line":29,"column":6},"end":{"line":29,"column":34}},"20":{"start":{"line":34,"column":0},"end":{"line":42,"column":1}},"21":{"start":{"line":35,"column":2},"end":{"line":41,"column":4}},"22":{"start":{"line":36,"column":4},"end":{"line":40,"column":5}},"23":{"start":{"line":37,"column":6},"end":{"line":37,"column":22}},"24":{"start":{"line":39,"column":6},"end":{"line":39,"column":28}},"25":{"start":{"line":44,"column":0},"end":{"line":52,"column":1}},"26":{"start":{"line":45,"column":2},"end":{"line":51,"column":4}},"27":{"start":{"line":46,"column":4},"end":{"line":50,"column":5}},"28":{"start":{"line":47,"column":6},"end":{"line":47,"column":33}},"29":{"start":{"line":49,"column":6},"end":{"line":49,"column":35}},"30":{"start":{"line":54,"column":0},"end":{"line":62,"column":1}},"31":{"start":{"line":55,"column":2},"end":{"line":61,"column":4}},"32":{"start":{"line":56,"column":4},"end":{"line":60,"column":5}},"33":{"start":{"line":57,"column":6},"end":{"line":57,"column":33}},"34":{"start":{"line":59,"column":6},"end":{"line":59,"column":32}},"35":{"start":{"line":64,"column":0},"end":{"line":72,"column":1}},"36":{"start":{"line":65,"column":2},"end":{"line":65,"column":22}},"37":{"start":{"line":66,"column":2},"end":{"line":71,"column":7}},"38":{"start":{"line":67,"column":4},"end":{"line":69,"column":5}},"39":{"start":{"line":68,"column":6},"end":{"line":68,"column":33}},"40":{"start":{"line":70,"column":4},"end":{"line":70,"column":29}},"41":{"start":{"line":74,"column":0},"end":{"line":86,"column":1}},"42":{"start":{"line":75,"column":2},"end":{"line":85,"column":4}},"43":{"start":{"line":80,"column":4},"end":{"line":84,"column":5}},"44":{"start":{"line":81,"column":6},"end":{"line":81,"column":33}},"45":{"start":{"line":83,"column":6},"end":{"line":83,"column":34}},"46":{"start":{"line":88,"column":0},"end":{"line":128,"column":1}},"47":{"start":{"line":90,"column":2},"end":{"line":127,"column":5}},"48":{"start":{"line":94,"column":4},"end":{"line":98,"column":5}},"49":{"start":{"line":95,"column":6},"end":{"line":95,"column":29}},"50":{"start":{"line":96,"column":11},"end":{"line":98,"column":5}},"51":{"start":{"line":97,"column":6},"end":{"line":97,"column":52}},"52":{"start":{"line":101,"column":6},"end":{"line":126,"column":7}},"53":{"start":{"line":102,"column":8},"end":{"line":104,"column":9}},"54":{"start":{"line":103,"column":10},"end":{"line":103,"column":33}},"55":{"start":{"line":107,"column":6},"end":{"line":107,"column":27}},"56":{"start":{"line":108,"column":6},"end":{"line":108,"column":30}},"57":{"start":{"line":109,"column":6},"end":{"line":109,"column":37}},"58":{"start":{"line":112,"column":6},"end":{"line":125,"column":9}},"59":{"start":{"line":120,"column":8},"end":{"line":122,"column":9}},"60":{"start":{"line":121,"column":10},"end":{"line":121,"column":33}},"61":{"start":{"line":124,"column":8},"end":{"line":124,"column":38}},"62":{"start":{"line":130,"column":0},"end":{"line":130,"column":24}}},"branchMap":{"1":{"line":16,"type":"if","locations":[{"start":{"line":16,"column":4},"end":{"line":16,"column":4}},{"start":{"line":16,"column":4},"end":{"line":16,"column":4}}]},"2":{"line":26,"type":"if","locations":[{"start":{"line":26,"column":4},"end":{"line":26,"column":4}},{"start":{"line":26,"column":4},"end":{"line":26,"column":4}}]},"3":{"line":36,"type":"if","locations":[{"start":{"line":36,"column":4},"end":{"line":36,"column":4}},{"start":{"line":36,"column":4},"end":{"line":36,"column":4}}]},"4":{"line":46,"type":"if","locations":[{"start":{"line":46,"column":4},"end":{"line":46,"column":4}},{"start":{"line":46,"column":4},"end":{"line":46,"column":4}}]},"5":{"line":56,"type":"if","locations":[{"start":{"line":56,"column":4},"end":{"line":56,"column":4}},{"start":{"line":56,"column":4},"end":{"line":56,"column":4}}]},"6":{"line":67,"type":"if","locations":[{"start":{"line":67,"column":4},"end":{"line":67,"column":4}},{"start":{"line":67,"column":4},"end":{"line":67,"column":4}}]},"7":{"line":80,"type":"if","locations":[{"start":{"line":80,"column":4},"end":{"line":80,"column":4}},{"start":{"line":80,"column":4},"end":{"line":80,"column":4}}]},"8":{"line":94,"type":"if","locations":[{"start":{"line":94,"column":4},"end":{"line":94,"column":4}},{"start":{"line":94,"column":4},"end":{"line":94,"column":4}}]},"9":{"line":96,"type":"if","locations":[{"start":{"line":96,"column":11},"end":{"line":96,"column":11}},{"start":{"line":96,"column":11},"end":{"line":96,"column":11}}]},"10":{"line":102,"type":"if","locations":[{"start":{"line":102,"column":8},"end":{"line":102,"column":8}},{"start":{"line":102,"column":8},"end":{"line":102,"column":8}}]},"11":{"line":120,"type":"if","locations":[{"start":{"line":120,"column":8},"end":{"line":120,"column":8}},{"start":{"line":120,"column":8},"end":{"line":120,"column":8}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/movies.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/movies.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1},"b":{},"f":{},"fnMap":{},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}},"3":{"start":{"line":3,"column":0},"end":{"line":3,"column":49}},"4":{"start":{"line":6,"column":0},"end":{"line":6,"column":37}},"5":{"start":{"line":7,"column":0},"end":{"line":7,"column":52}},"6":{"start":{"line":8,"column":0},"end":{"line":8,"column":61}},"7":{"start":{"line":9,"column":0},"end":{"line":9,"column":58}},"8":{"start":{"line":12,"column":0},"end":{"line":12,"column":24}}},"branchMap":{}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/movies.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/movies.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0},"fnMap":{"1":{"name":"(anonymous_1)","line":6,"loc":{"start":{"line":6,"column":12},"end":{"line":6,"column":31}}},"2":{"name":"(anonymous_2)","line":7,"loc":{"start":{"line":7,"column":12},"end":{"line":7,"column":36}}},"3":{"name":"(anonymous_3)","line":17,"loc":{"start":{"line":17,"column":15},"end":{"line":17,"column":34}}},"4":{"name":"(anonymous_4)","line":18,"loc":{"start":{"line":18,"column":58},"end":{"line":18,"column":80}}},"5":{"name":"(anonymous_5)","line":29,"loc":{"start":{"line":29,"column":22},"end":{"line":29,"column":41}}},"6":{"name":"(anonymous_6)","line":30,"loc":{"start":{"line":30,"column":41},"end":{"line":30,"column":70}}},"7":{"name":"(anonymous_7)","line":40,"loc":{"start":{"line":40,"column":19},"end":{"line":40,"column":38}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":48}},"3":{"start":{"line":5,"column":0},"end":{"line":43,"column":1}},"4":{"start":{"line":7,"column":2},"end":{"line":14,"column":4}},"5":{"start":{"line":8,"column":3},"end":{"line":13,"column":4}},"6":{"start":{"line":9,"column":4},"end":{"line":9,"column":74}},"7":{"start":{"line":10,"column":4},"end":{"line":10,"column":21}},"8":{"start":{"line":12,"column":4},"end":{"line":12,"column":20}},"9":{"start":{"line":18,"column":2},"end":{"line":26,"column":4}},"10":{"start":{"line":19,"column":3},"end":{"line":24,"column":4}},"11":{"start":{"line":20,"column":4},"end":{"line":20,"column":40}},"12":{"start":{"line":21,"column":4},"end":{"line":21,"column":21}},"13":{"start":{"line":23,"column":4},"end":{"line":23,"column":18}},"14":{"start":{"line":30,"column":3},"end":{"line":37,"column":4}},"15":{"start":{"line":31,"column":3},"end":{"line":36,"column":4}},"16":{"start":{"line":32,"column":4},"end":{"line":32,"column":61}},"17":{"start":{"line":33,"column":4},"end":{"line":33,"column":21}},"18":{"start":{"line":35,"column":5},"end":{"line":35,"column":26}},"19":{"start":{"line":45,"column":0},"end":{"line":45,"column":33}}},"branchMap":{"1":{"line":8,"type":"if","locations":[{"start":{"line":8,"column":3},"end":{"line":8,"column":3}},{"start":{"line":8,"column":3},"end":{"line":8,"column":3}}]},"2":{"line":19,"type":"if","locations":[{"start":{"line":19,"column":3},"end":{"line":19,"column":3}},{"start":{"line":19,"column":3},"end":{"line":19,"column":3}}]},"3":{"line":31,"type":"if","locations":[{"start":{"line":31,"column":3},"end":{"line":31,"column":3}},{"start":{"line":31,"column":3},"end":{"line":31,"column":3}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/movies_model.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/movies_model.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":1,"7":0,"8":0,"9":0,"10":0,"11":0,"12":1,"13":0,"14":0,"15":0,"16":0,"17":1,"18":0,"19":0,"20":0,"21":0,"22":0,"23":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0},"fnMap":{"1":{"name":"(anonymous_1)","line":4,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":39}}},"2":{"name":"(anonymous_2)","line":9,"loc":{"start":{"line":9,"column":12},"end":{"line":9,"column":31}}},"3":{"name":"(anonymous_3)","line":10,"loc":{"start":{"line":10,"column":17},"end":{"line":10,"column":41}}},"4":{"name":"(anonymous_4)","line":14,"loc":{"start":{"line":14,"column":32},"end":{"line":14,"column":48}}},"5":{"name":"(anonymous_5)","line":21,"loc":{"start":{"line":21,"column":18},"end":{"line":21,"column":44}}},"6":{"name":"(anonymous_6)","line":22,"loc":{"start":{"line":22,"column":36},"end":{"line":22,"column":59}}},"7":{"name":"(anonymous_7)","line":33,"loc":{"start":{"line":33,"column":13},"end":{"line":33,"column":46}}},"8":{"name":"(anonymous_8)","line":39,"loc":{"start":{"line":39,"column":5},"end":{"line":39,"column":29}}},"9":{"name":"(anonymous_9)","line":43,"loc":{"start":{"line":43,"column":33},"end":{"line":43,"column":50}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}},"3":{"start":{"line":4,"column":0},"end":{"line":7,"column":1}},"4":{"start":{"line":5,"column":2},"end":{"line":5,"column":21}},"5":{"start":{"line":6,"column":2},"end":{"line":6,"column":29}},"6":{"start":{"line":9,"column":0},"end":{"line":19,"column":2}},"7":{"start":{"line":10,"column":2},"end":{"line":18,"column":4}},"8":{"start":{"line":11,"column":4},"end":{"line":17,"column":5}},"9":{"start":{"line":12,"column":6},"end":{"line":12,"column":75}},"10":{"start":{"line":14,"column":6},"end":{"line":16,"column":9}},"11":{"start":{"line":15,"column":8},"end":{"line":15,"column":38}},"12":{"start":{"line":21,"column":0},"end":{"line":31,"column":2}},"13":{"start":{"line":22,"column":2},"end":{"line":30,"column":4}},"14":{"start":{"line":24,"column":4},"end":{"line":29,"column":5}},"15":{"start":{"line":26,"column":6},"end":{"line":26,"column":65}},"16":{"start":{"line":28,"column":6},"end":{"line":28,"column":27}},"17":{"start":{"line":33,"column":0},"end":{"line":48,"column":1}},"18":{"start":{"line":35,"column":1},"end":{"line":47,"column":4}},"19":{"start":{"line":40,"column":4},"end":{"line":46,"column":5}},"20":{"start":{"line":41,"column":6},"end":{"line":41,"column":74}},"21":{"start":{"line":43,"column":6},"end":{"line":45,"column":9}},"22":{"start":{"line":44,"column":8},"end":{"line":44,"column":20}},"23":{"start":{"line":50,"column":0},"end":{"line":50,"column":23}}},"branchMap":{"1":{"line":11,"type":"if","locations":[{"start":{"line":11,"column":4},"end":{"line":11,"column":4}},{"start":{"line":11,"column":4},"end":{"line":11,"column":4}}]},"2":{"line":11,"type":"binary-expr","locations":[{"start":{"line":11,"column":8},"end":{"line":11,"column":13}},{"start":{"line":11,"column":16},"end":{"line":11,"column":23}}]},"3":{"line":12,"type":"binary-expr","locations":[{"start":{"line":12,"column":15},"end":{"line":12,"column":20}},{"start":{"line":12,"column":24},"end":{"line":12,"column":62}}]},"4":{"line":24,"type":"if","locations":[{"start":{"line":24,"column":4},"end":{"line":24,"column":4}},{"start":{"line":24,"column":4},"end":{"line":24,"column":4}}]},"5":{"line":24,"type":"binary-expr","locations":[{"start":{"line":24,"column":8},"end":{"line":24,"column":13}},{"start":{"line":24,"column":17},"end":{"line":24,"column":23}}]},"6":{"line":26,"type":"binary-expr","locations":[{"start":{"line":26,"column":15},"end":{"line":26,"column":20}},{"start":{"line":26,"column":24},"end":{"line":26,"column":52}}]},"7":{"line":40,"type":"if","locations":[{"start":{"line":40,"column":4},"end":{"line":40,"column":4}},{"start":{"line":40,"column":4},"end":{"line":40,"column":4}}]},"8":{"line":40,"type":"binary-expr","locations":[{"start":{"line":40,"column":8},"end":{"line":40,"column":13}},{"start":{"line":40,"column":17},"end":{"line":40,"column":24}}]},"9":{"line":41,"type":"binary-expr","locations":[{"start":{"line":41,"column":15},"end":{"line":41,"column":20}},{"start":{"line":41,"column":24},"end":{"line":41,"column":62}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/rentals.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/rentals.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1},"b":{},"f":{},"fnMap":{},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}},"3":{"start":{"line":3,"column":0},"end":{"line":3,"column":50}},"4":{"start":{"line":5,"column":0},"end":{"line":5,"column":52}},"5":{"start":{"line":6,"column":0},"end":{"line":6,"column":44}},"6":{"start":{"line":7,"column":0},"end":{"line":7,"column":63}},"7":{"start":{"line":9,"column":0},"end":{"line":9,"column":74}},"8":{"start":{"line":12,"column":0},"end":{"line":12,"column":54}},"9":{"start":{"line":17,"column":0},"end":{"line":17,"column":24}}},"branchMap":{}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/rentals.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/rentals.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0},"fnMap":{"1":{"name":"(anonymous_1)","line":5,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":32}}},"2":{"name":"(anonymous_2)","line":6,"loc":{"start":{"line":6,"column":36},"end":{"line":6,"column":59}}},"3":{"name":"(anonymous_3)","line":11,"loc":{"start":{"line":11,"column":41},"end":{"line":11,"column":70}}},"4":{"name":"(anonymous_4)","line":26,"loc":{"start":{"line":26,"column":22},"end":{"line":26,"column":41}}},"5":{"name":"(anonymous_5)","line":27,"loc":{"start":{"line":27,"column":41},"end":{"line":27,"column":70}}},"6":{"name":"(anonymous_6)","line":37,"loc":{"start":{"line":37,"column":21},"end":{"line":37,"column":46}}},"7":{"name":"(anonymous_7)","line":38,"loc":{"start":{"line":38,"column":62},"end":{"line":38,"column":91}}},"8":{"name":"(anonymous_8)","line":48,"loc":{"start":{"line":48,"column":19},"end":{"line":48,"column":38}}},"9":{"name":"(anonymous_9)","line":49,"loc":{"start":{"line":49,"column":34},"end":{"line":49,"column":60}}},"10":{"name":"(anonymous_10)","line":60,"loc":{"start":{"line":60,"column":20},"end":{"line":60,"column":39}}},"11":{"name":"(anonymous_11)","line":61,"loc":{"start":{"line":61,"column":20},"end":{"line":61,"column":46}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":46}},"3":{"start":{"line":4,"column":0},"end":{"line":70,"column":1}},"4":{"start":{"line":6,"column":2},"end":{"line":23,"column":4}},"5":{"start":{"line":7,"column":3},"end":{"line":21,"column":4}},"6":{"start":{"line":8,"column":4},"end":{"line":8,"column":41}},"7":{"start":{"line":9,"column":4},"end":{"line":9,"column":21}},"8":{"start":{"line":11,"column":4},"end":{"line":20,"column":6}},"9":{"start":{"line":12,"column":5},"end":{"line":18,"column":6}},"10":{"start":{"line":19,"column":5},"end":{"line":19,"column":26}},"11":{"start":{"line":27,"column":3},"end":{"line":34,"column":4}},"12":{"start":{"line":28,"column":3},"end":{"line":33,"column":4}},"13":{"start":{"line":29,"column":4},"end":{"line":29,"column":61}},"14":{"start":{"line":30,"column":4},"end":{"line":30,"column":21}},"15":{"start":{"line":32,"column":5},"end":{"line":32,"column":26}},"16":{"start":{"line":38,"column":2},"end":{"line":45,"column":5}},"17":{"start":{"line":39,"column":3},"end":{"line":44,"column":4}},"18":{"start":{"line":40,"column":4},"end":{"line":40,"column":61}},"19":{"start":{"line":41,"column":4},"end":{"line":41,"column":21}},"20":{"start":{"line":43,"column":4},"end":{"line":43,"column":25}},"21":{"start":{"line":49,"column":2},"end":{"line":56,"column":5}},"22":{"start":{"line":50,"column":3},"end":{"line":55,"column":4}},"23":{"start":{"line":51,"column":4},"end":{"line":51,"column":61}},"24":{"start":{"line":52,"column":4},"end":{"line":52,"column":21}},"25":{"start":{"line":54,"column":4},"end":{"line":54,"column":22}},"26":{"start":{"line":61,"column":2},"end":{"line":68,"column":5}},"27":{"start":{"line":62,"column":3},"end":{"line":67,"column":4}},"28":{"start":{"line":63,"column":4},"end":{"line":63,"column":33}},"29":{"start":{"line":64,"column":4},"end":{"line":64,"column":21}},"30":{"start":{"line":66,"column":4},"end":{"line":66,"column":22}},"31":{"start":{"line":72,"column":0},"end":{"line":72,"column":34}}},"branchMap":{"1":{"line":7,"type":"if","locations":[{"start":{"line":7,"column":3},"end":{"line":7,"column":3}},{"start":{"line":7,"column":3},"end":{"line":7,"column":3}}]},"2":{"line":28,"type":"if","locations":[{"start":{"line":28,"column":3},"end":{"line":28,"column":3}},{"start":{"line":28,"column":3},"end":{"line":28,"column":3}}]},"3":{"line":39,"type":"if","locations":[{"start":{"line":39,"column":3},"end":{"line":39,"column":3}},{"start":{"line":39,"column":3},"end":{"line":39,"column":3}}]},"4":{"line":50,"type":"if","locations":[{"start":{"line":50,"column":3},"end":{"line":50,"column":3}},{"start":{"line":50,"column":3},"end":{"line":50,"column":3}}]},"5":{"line":62,"type":"if","locations":[{"start":{"line":62,"column":3},"end":{"line":62,"column":3}},{"start":{"line":62,"column":3},"end":{"line":62,"column":3}}]}}}} \ No newline at end of file diff --git a/coverage/lcov-report/VideoStoreAPI/app.js.html b/coverage/lcov-report/VideoStoreAPI/app.js.html new file mode 100644 index 000000000..36d2cff2e --- /dev/null +++ b/coverage/lcov-report/VideoStoreAPI/app.js.html @@ -0,0 +1,308 @@ + + + + Code coverage report for VideoStoreAPI/app.js + + + + + + + +
+
+

+ all files / VideoStoreAPI/ app.js +

+
+
+ 78.95% + Statements + 30/38 +
+
+ 16.67% + Branches + 1/6 +
+
+ 0% + Functions + 0/3 +
+
+ 78.95% + Lines + 30/38 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +821× +1× +1× +1× +1× +1× +1× +1× +  +  +1× +  +  +  +  +1× +  +  +1× +  +  +  +1× +1× +  +  +  +1× +  +  +1× +1× +1× +1× +  +1× +1× +1× +1× +  +  +  +1× +1× +1× +1× +  +  +  +1× +  +  +  +  +  +  +  +  +  +1× +  +  +  +  +  +  +  +  +  +  +  +1× +  +  +  +  +  +  +  +  +1× + 
var express = require('express');
+var path = require('path');
+var favicon = require('serve-favicon');
+var logger = require('morgan');
+var cookieParser = require('cookie-parser');
+var bodyParser = require('body-parser');
+var massive = require("massive");
+var app = module.exports = express();
+//
+// var connectionString = "postgres://localhost/video_store"
+var connectionString = "postgres://localhost/video_store_" + app.get('env');
+ 
+// connect to Massive and get the db instance. You can safely use the
+// convenience sync method here because its on app load
+// you can also use loadSync - it's an alias
+var massiveInstance = massive.connectSync({connectionString : connectionString})
+ 
+// Set a reference to the massive instance on Express' app:
+app.set('db', massiveInstance);
+ 
+ 
+// view engine setup
+app.set('views', path.join(__dirname, 'views'));
+app.set('view engine', 'jade');
+ 
+// uncomment after placing your favicon in /public
+//app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
+app.use(logger('dev'));
+// this will terminate the request with an error 400 if the POST body
+// doesn't contain valid json
+app.use(bodyParser.json());
+app.use(bodyParser.urlencoded({ extended: false }));
+app.use(cookieParser());
+app.use(express.static(path.join(__dirname, 'public')));
+ 
+var routes    = require('./routes/index');
+var customers = require('./routes/customers');
+var movies    = require('./routes/movies');
+var rentals   = require('./routes/rentals');
+ 
+ 
+ 
+app.use('/', routes);
+app.use('/customers', customers);
+app.use('/movies', movies);
+app.use('/rentals', rentals);
+ 
+ 
+// catch 404 and forward to error handler
+app.use(function(req, res, next) {
+  var err = new Error('Not Found');
+  err.status = 404;
+  next(err);
+});
+ 
+// error handlers
+ 
+// development error handler
+// will print stacktrace
+Iif (app.get('env') === 'development') {
+  app.use(function(err, req, res, next) {
+    res.status(err.status || 500);
+    res.render('error', {
+      message: err.message,
+      error: err
+    });
+  });
+}
+ 
+// production error handler
+// no stacktraces leaked to user
+app.use(function(err, req, res, next) {
+  res.status(err.status || 500);
+  res.render('error', {
+    message: err.message,
+    error: {}
+  });
+});
+ 
+ 
+module.exports = app;
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/VideoStoreAPI/controllers/customers.js.html b/coverage/lcov-report/VideoStoreAPI/controllers/customers.js.html new file mode 100644 index 000000000..9495977c4 --- /dev/null +++ b/coverage/lcov-report/VideoStoreAPI/controllers/customers.js.html @@ -0,0 +1,221 @@ + + + + Code coverage report for VideoStoreAPI/controllers/customers.js + + + + + + + +
+
+

+ all files / VideoStoreAPI/controllers/ customers.js +

+
+
+ 16.67% + Statements + 4/24 +
+
+ 0% + Branches + 0/8 +
+
+ 0% + Functions + 0/8 +
+
+ 16.67% + Lines + 4/24 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +531× +1× +  +  +1× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× + 
var Customer = require("../models/customers_model");
+var Rental = require("../models/rentals_model");
+ 
+ 
+var CustomersController = {
+	getCustomers: function(req, res) {
+		Customer.all(function(error, customers) {
+			if(error) {
+				var err = new Error("Error retrieving account list;\n" + error.message);
+				err.status = 500;
+			} else {
+				res.json(customers)
+			}
+		})
+ 
+	},
+	// customer id, sort column, offest ?????
+	subsetCustomers: function(req, res) {
+		Customer.sort(req.params.column, req.query.p, req.query.n, function(error, data) {
+			if(error) {
+				var err = new Error("No such data");
+				err.status = 404;
+			} else {
+					res.json(data)
+			}
+		})
+	},
+ 
+	// customer id, all rentals attached to customer id within data params
+	getCustomersCurrent: function(req, res) {
+		Rental.getCurrentRentals(req.params.customer_id, function(error, data) {
+			if(error) {
+				var err = new Error("No such data");
+				err.status = 404;
+			} else {
+					res.json(data)
+			}
+		})
+	},
+ 
+	getCustomersHistory: function(req, res) {
+		Rental.getPastRentals(req.params.customer_id, function(error, data) {
+			if(error) {
+				var err = new Error("No such data");
+				err.status = 404;
+			} else {
+					res.json(data)
+			}
+		})
+	}
+}
+module.exports = CustomersController
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/VideoStoreAPI/controllers/index.html b/coverage/lcov-report/VideoStoreAPI/controllers/index.html new file mode 100644 index 000000000..fe852a326 --- /dev/null +++ b/coverage/lcov-report/VideoStoreAPI/controllers/index.html @@ -0,0 +1,119 @@ + + + + Code coverage report for VideoStoreAPI/controllers/ + + + + + + + +
+
+

+ all files VideoStoreAPI/controllers/ +

+
+
+ 16.22% + Statements + 12/74 +
+
+ 0% + Branches + 0/24 +
+
+ 0% + Functions + 0/26 +
+
+ 16.22% + Lines + 12/74 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
customers.js
16.67%4/240%0/80%0/816.67%4/24
movies.js
21.05%4/190%0/60%0/721.05%4/19
rentals.js
12.9%4/310%0/100%0/1112.9%4/31
+
+
+ + + + + + + diff --git a/coverage/lcov-report/VideoStoreAPI/controllers/movies.js.html b/coverage/lcov-report/VideoStoreAPI/controllers/movies.js.html new file mode 100644 index 000000000..6a6692dbf --- /dev/null +++ b/coverage/lcov-report/VideoStoreAPI/controllers/movies.js.html @@ -0,0 +1,200 @@ + + + + Code coverage report for VideoStoreAPI/controllers/movies.js + + + + + + + +
+
+

+ all files / VideoStoreAPI/controllers/ movies.js +

+
+
+ 21.05% + Statements + 4/19 +
+
+ 0% + Branches + 0/6 +
+
+ 0% + Functions + 0/7 +
+
+ 21.05% + Lines + 4/19 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +461× +1× +  +  +1× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× + 
var Movie = require("../models/movies_model");
+var Rental = require("../models/rentals_model");
+ 
+ 
+MoviesController = {
+	getMovies: function(req, res) {
+		Movie.all(function(error, movies) {
+			if(error) {
+				var err = new Error("Error retrieving movie list;\n" + error.message);
+				err.status = 500;
+			} else {
+				res.json(movies)
+			}
+		})
+	},
+ 
+	subsetMovies: function(req, res) {
+		Movie.sort(req.params.column, req.query.p, req.query.n, function(error, data) {
+			if(error) {
+				var err = new Error("No such data");
+				err.status = 404;
+			} else {
+				res.json(data)
+			}
+ 
+		})
+	},
+ 
+	getRentalsCustomers: function(req, res) {
+			Rental.getCustomers(req.params.title, function(error, checked_out) {
+			if(error) {
+				var err = new Error("No one has that movie checked out");
+				err.status = 404;
+			} else {
+					res.json(checked_out)
+			}
+		})
+	},
+ 
+	getMoviesHistory: function(req, res) {
+ 
+	}
+}
+ 
+module.exports = MoviesController
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/VideoStoreAPI/controllers/rentals.js.html b/coverage/lcov-report/VideoStoreAPI/controllers/rentals.js.html new file mode 100644 index 000000000..fa290b53a --- /dev/null +++ b/coverage/lcov-report/VideoStoreAPI/controllers/rentals.js.html @@ -0,0 +1,281 @@ + + + + Code coverage report for VideoStoreAPI/controllers/rentals.js + + + + + + + +
+
+

+ all files / VideoStoreAPI/controllers/ rentals.js +

+
+
+ 12.9% + Statements + 4/31 +
+
+ 0% + Branches + 0/10 +
+
+ 0% + Functions + 0/11 +
+
+ 12.9% + Lines + 4/31 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +731× +1× +  +1× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× + 
var Rental = require("../models/rentals_model");
+var Movie = require("../models/movies_model");
+ 
+RentalsController = {
+	getRentals: function(req, res) {
+		Movie.findMovie(req.params.title, function(error, movie) {
+			if(error) {
+				var err = new Error("No such movie");
+				err.status = 404;
+			} else {
+				Rental.getCurrentlyCheckedOut(movie, function(error, checked_out) {
+					var return_data = {
+						title:movie.title,
+						overview:movie.overview,
+						release_date:movie.release_date,
+						total_inventory:movie.inventory,
+						available_copies:(parseInt(movie.inventory))-(parseInt(checked_out))
+					} 
+					res.json(return_data)
+				})
+			}
+ 
+		})
+	},
+ 
+	getRentalsCustomers: function(req, res) {
+			Rental.getCustomers(req.params.title, function(error, checked_out) {
+			if(error) {
+				var err = new Error("No one has that movie checked out");
+				err.status = 404;
+			} else {
+					res.json(checked_out)
+			}
+		})
+	},
+ 
+	getRentalsCheckOut: function(req, res, next) {
+		Rental.getCheckout(req.params.title, req.params.customerid, function(error, checked_out) {
+			if(error) {
+				var err = new Error("No one has that movie checked out");
+				err.status = 404;
+			} else {
+				res.json(checked_out)
+			}
+		});
+	},
+ 
+	getRentalsReturn: function(req, res) {
+		Rental.getReturn(req.params.id, function(error, returned) {
+			if(error) {
+				var err = new Error("No one has that movie checked out");
+				err.status = 404;
+			} else {
+				res.json(returned)
+			}
+		});
+ 
+	},
+ 
+	getRentalsOverdue: function(req, res) {
+		Rental.getOverdue(function(error, over_due) {
+			if(error) {
+				var err = new Error("Ooops");
+				err.status = 404;
+			} else {
+				res.json(over_due)
+			}
+		});
+	}
+}
+ 
+module.exports = RentalsController
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/VideoStoreAPI/index.html b/coverage/lcov-report/VideoStoreAPI/index.html new file mode 100644 index 000000000..a56d5ab12 --- /dev/null +++ b/coverage/lcov-report/VideoStoreAPI/index.html @@ -0,0 +1,93 @@ + + + + Code coverage report for VideoStoreAPI/ + + + + + + + +
+
+

+ all files VideoStoreAPI/ +

+
+
+ 78.95% + Statements + 30/38 +
+
+ 16.67% + Branches + 1/6 +
+
+ 0% + Functions + 0/3 +
+
+ 78.95% + Lines + 30/38 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
app.js
78.95%30/3816.67%1/60%0/378.95%30/38
+
+
+ + + + + + + diff --git a/coverage/lcov-report/VideoStoreAPI/models/customers_model.js.html b/coverage/lcov-report/VideoStoreAPI/models/customers_model.js.html new file mode 100644 index 000000000..528e0e8b7 --- /dev/null +++ b/coverage/lcov-report/VideoStoreAPI/models/customers_model.js.html @@ -0,0 +1,176 @@ + + + + Code coverage report for VideoStoreAPI/models/customers_model.js + + + + + + + +
+
+

+ all files / VideoStoreAPI/models/ customers_model.js +

+
+
+ 35.29% + Statements + 6/17 +
+
+ 0% + Branches + 0/12 +
+
+ 0% + Functions + 0/7 +
+
+ 35.29% + Lines + 6/17 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +381× +1× +  +1× +  +  +  +1× +  +  +  +  +  +  +  +  +  +  +  +1× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× + 
var app = require("../app");
+var db = app.get("db");
+ 
+var Customer = function(id) {
+  this.id = id;
+}
+ 
+Customer.all = function(callback) {
+  db.customers.find(function(error, customers) {
+    if (error|| !customers) {
+      callback(error || new Error("Could not retrieve customers"), undefined);
+    } else {
+      callback(null, customers.map(function(customer) {
+        return new Customer(customer.id);
+      }))
+    };
+  })
+};
+ 
+Customer.sort = function(column, p, n, callback) {
+  // sort by column, for n number of records starting at p
+ db.customers.find({}, {
+    order: column,
+    limit: n,
+    offset: p
+  }, function(error, customers) {
+    if (error || !customers) {
+      callback(error || new Error("Could not retrieve customers"), undefined)
+    } else {
+      callback(null, customers.map (function (customer) {
+        return customer
+      }))
+    }
+  })
+}
+ 
+module.exports = Customer;
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/VideoStoreAPI/models/index.html b/coverage/lcov-report/VideoStoreAPI/models/index.html new file mode 100644 index 000000000..d3f4e017b --- /dev/null +++ b/coverage/lcov-report/VideoStoreAPI/models/index.html @@ -0,0 +1,119 @@ + + + + Code coverage report for VideoStoreAPI/models/ + + + + + + + +
+
+

+ all files VideoStoreAPI/models/ +

+
+
+ 24.51% + Statements + 25/102 +
+
+ 0% + Branches + 0/52 +
+
+ 0% + Functions + 0/35 +
+
+ 24.51% + Lines + 25/102 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
customers_model.js
35.29%6/170%0/120%0/735.29%6/17
movies_model.js
30.43%7/230%0/180%0/930.43%7/23
rentals_model.js
19.35%12/620%0/220%0/1919.35%12/62
+
+
+ + + + + + + diff --git a/coverage/lcov-report/VideoStoreAPI/models/movies_model.js.html b/coverage/lcov-report/VideoStoreAPI/models/movies_model.js.html new file mode 100644 index 000000000..4e2c26522 --- /dev/null +++ b/coverage/lcov-report/VideoStoreAPI/models/movies_model.js.html @@ -0,0 +1,215 @@ + + + + Code coverage report for VideoStoreAPI/models/movies_model.js + + + + + + + +
+
+

+ all files / VideoStoreAPI/models/ movies_model.js +

+
+
+ 30.43% + Statements + 7/23 +
+
+ 0% + Branches + 0/18 +
+
+ 0% + Functions + 0/9 +
+
+ 30.43% + Lines + 7/23 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +511× +1× +  +1× +  +  +  +  +1× +  +  +  +  +  +  +  +  +  +  +  +1× +  +  +  +  +  +  +  +  +  +  +  +1× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× + 
var app = require("../app");
+var db = app.get("db");
+ 
+var Movie = function(title, inventory) {
+  this.title = title;
+  this.inventory = inventory;
+}
+ 
+Movie.all = function(callback) {
+  db.movies.find(function(error, movies) {
+    if (error|| !movies) {
+      callback(error || new Error("Could not retrieve movies"), undefined);
+    } else {
+      callback(null, movies.map(function(movie) {
+        return new Movie(movie.title);
+      }))
+    };
+  })
+};
+ 
+Movie.findMovie = function(title, callback) {
+  db.movies.findOne({title: title}, function(error, movie) {
+ 
+    if (error || !movie) {
+ 
+      callback(error || new Error("Movie not found"), undefined);
+    } else {
+      callback(null, movie)
+    }
+  })
+};
+ 
+Movie.sort = function(column, p, n, callback) {
+  // sort by column, for n number of records starting at p
+ db.movies.find({}, {
+    order: column,
+    limit: n,
+    offset: p
+  }, function(error, movies) {
+    if (error || !movies) {
+      callback(error || new Error("Could not retrieve movies"), undefined)
+    } else {
+      callback(null, movies.map (function (movie) {
+        return movie
+      }))
+    }
+  })
+}
+ 
+module.exports = Movie;
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/VideoStoreAPI/models/rentals_model.js.html b/coverage/lcov-report/VideoStoreAPI/models/rentals_model.js.html new file mode 100644 index 000000000..552f16ffd --- /dev/null +++ b/coverage/lcov-report/VideoStoreAPI/models/rentals_model.js.html @@ -0,0 +1,455 @@ + + + + Code coverage report for VideoStoreAPI/models/rentals_model.js + + + + + + + +
+
+

+ all files / VideoStoreAPI/models/ rentals_model.js +

+
+
+ 19.35% + Statements + 12/62 +
+
+ 0% + Branches + 0/22 +
+
+ 0% + Functions + 0/19 +
+
+ 19.35% + Lines + 12/62 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +1311× +1× +  +1× +  +  +  +  +  +  +  +  +  +1× +  +  +  +  +  +  +  +  +  +1× +  +  +  +  +  +  +  +  +  +1× +  +  +  +  +  +  +  +  +  +1× +  +  +  +  +  +  +  +  +  +1× +  +  +  +  +  +  +  +  +  +1× +  +  +  +  +  +  +  +  +  +1× +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× + 
var app = require("../app");
+var db = app.get("db");
+ 
+var Rental = function(movie_id, customer_id, created_date, due_date, returned = false, returned_date = null) {
+  this.movie_id = movie_id;
+  this.customer_id = customer_id;
+  this.created_date = created_date;
+  this.due_date = due_date;
+  this.returned = returned;
+  this.returned_date = returned_date;
+ 
+};
+ 
+Rental.getCheckedOut = function(title, callback) {
+  db.rentals.where("title=$1 AND returned=$2", [title, false], function(error, checked_out) {
+    if(error) {
+      callback(error, undefined);
+    } else {
+      callback(null, checked_out);
+    }
+  })
+}
+ 
+Rental.getCurrentRentals = function(customer_id, callback) {
+  db.rentals.where("customer_id=$1 AND returned=$2", [customer_id, false], function(error, checked_out) {
+    if(error) {
+      callback(error, undefined);
+    } else {
+      callback(null, checked_out);
+    }
+  })
+}
+ 
+Rental.getCurrentlyCheckedOut = function(movie, callback) {
+  db.rentals.count({movie_id: movie.id, returned: false}, function (error, count) {
+    if(error) {
+      callback(error);
+    } else {
+      callback(null, count);
+    }
+  })
+}
+ 
+Rental.getPastRentals = function(customer_id, callback) {
+  db.run("SELECT customer_id, created_date, movie_id, returned_date FROM rentals WHERE customer_id=$1 AND returned=$2 ORDER BY returned_date ASC", [customer_id, true], function(error, past_rentals) {
+    if(error) {
+      callback(error, undefined);
+    } else {
+      callback(null, past_rentals);
+    }
+  })
+}
+ 
+Rental.getCustomers = function(movie_title, callback) {
+  db.run("SELECT * FROM customers WHERE id=(SELECT customer_id FROM rentals WHERE movie_id=(SELECT id FROM movies WHERE title=$1) AND returned=false)", [movie_title], function(error, customers) {
+    if(error) {
+      callback(error, undefined);
+    } else {
+      callback(null, customers);
+    }
+  })
+}
+ 
+Rental.getOverdue = function(callback) {
+  var now = new Date()
+  db.run("SELECT customers.name, movies.title, rentals.created_date, rentals.due_date FROM rentals INNER JOIN movies ON movies.id=rentals.movie_id INNER JOIN customers ON customers.id=rentals.customer_id WHERE rentals.returned=false AND rentals.due_date<$1", [now], function (error, overdues) {
+    if (error) {
+      callback(error, undefined);
+    }
+    callback(null, overdues);
+    });
+}
+ 
+Rental.getReturn = function(rental_id, callback) {
+  db.rentals.update({
+    id: rental_id,
+    returned: true,
+    returned_date: new Date()
+    }, function(error, checked_out) {
+    if(error) {
+      callback(error, undefined);
+    } else {
+      callback(null, checked_out);
+    }
+  })
+}
+ 
+Rental.getCheckout = function(movie_title, id, callback) {
+    // get movie id from movie table by title
+  db.movies.findOne({
+    title: movie_title
+    // call back with movie id
+  }, function (error, movie) {
+    if (error) {
+      return callback(error);
+    } else if (!movie) {
+      return callback(new Error("Movie not found"));
+    }
+ 
+        // remove money from account
+      db.run("UPDATE customers SET account_credit=account_credit-2.0 WHERE id=$1;", [id], function (error, movie_id = movie, account_balance_update) {
+        if (error) {
+          return callback(error);
+        }
+ 
+      // set date vars
+      var now = new Date();
+      var due = new Date(now);
+      due.setDate(due.getDate() + 7);
+ 
+      // save new rental (nested inside find)
+      db.rentals.save({
+        movie_id: movie_id.id,
+        customer_id: id,
+        created_date: now,
+        due_date: due,
+        returned: false
+        // callback with rental info
+      }, function (error, rental) {
+        if (error) {
+          return callback(error);
+        }
+        // pass rental back to controller
+        return callback(null, rental);
+      });
+    });
+  });
+}
+ 
+module.exports = Rental;
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/VideoStoreAPI/routes/customers.js.html b/coverage/lcov-report/VideoStoreAPI/routes/customers.js.html new file mode 100644 index 000000000..c97e9bfea --- /dev/null +++ b/coverage/lcov-report/VideoStoreAPI/routes/customers.js.html @@ -0,0 +1,101 @@ + + + + Code coverage report for VideoStoreAPI/routes/customers.js + + + + + + + +
+
+

+ all files / VideoStoreAPI/routes/ customers.js +

+
+
+ 100% + Statements + 8/8 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 8/8 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +131× +1× +1× +  +  +1× +1× +1× +1× +  +  +1× + 
var express = require('express');
+var router = express.Router();
+var Controller = require('../controllers/customers')
+ 
+// select all from db
+router.get('/', Controller.getCustomers)
+router.get('/sort/:column', Controller.subsetCustomers)
+router.get('/:customer_id/current', Controller.getCustomersCurrent)
+router.get('/:customer_id/history', Controller.getCustomersHistory)
+ 
+ 
+module.exports = router;
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/VideoStoreAPI/routes/index.html b/coverage/lcov-report/VideoStoreAPI/routes/index.html new file mode 100644 index 000000000..222b4200a --- /dev/null +++ b/coverage/lcov-report/VideoStoreAPI/routes/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for VideoStoreAPI/routes/ + + + + + + + +
+
+

+ all files VideoStoreAPI/routes/ +

+
+
+ 93.75% + Statements + 30/32 +
+
+ 100% + Branches + 0/0 +
+
+ 0% + Functions + 0/2 +
+
+ 93.75% + Lines + 30/32 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
customers.js
100%8/8100%0/0100%0/0100%8/8
index.js
71.43%5/7100%0/00%0/271.43%5/7
movies.js
100%8/8100%0/0100%0/0100%8/8
rentals.js
100%9/9100%0/0100%0/0100%9/9
+
+
+ + + + + + + diff --git a/coverage/lcov-report/VideoStoreAPI/routes/index.js.html b/coverage/lcov-report/VideoStoreAPI/routes/index.js.html new file mode 100644 index 000000000..c20955912 --- /dev/null +++ b/coverage/lcov-report/VideoStoreAPI/routes/index.js.html @@ -0,0 +1,107 @@ + + + + Code coverage report for VideoStoreAPI/routes/index.js + + + + + + + +
+
+

+ all files / VideoStoreAPI/routes/ index.js +

+
+
+ 71.43% + Statements + 5/7 +
+
+ 100% + Branches + 0/0 +
+
+ 0% + Functions + 0/2 +
+
+ 71.43% + Lines + 5/7 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +151× +1× +  +  +  +1× +  +  +  +1× +  +  +  +1× + 
var express = require('express');
+var router = express.Router();
+// var Controller = require('../controllers/scrabble')
+ 
+/* GET home page. */
+router.get('/', function(req, res, next) {
+  res.status(200).json({index: 'index'})
+});
+ 
+router.get('/zomg', function(req, res, next) {
+  res.status(200).json({whatevs: 'it works!!!!'})
+});
+ 
+module.exports = router;
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/VideoStoreAPI/routes/movies.js.html b/coverage/lcov-report/VideoStoreAPI/routes/movies.js.html new file mode 100644 index 000000000..04c54fb61 --- /dev/null +++ b/coverage/lcov-report/VideoStoreAPI/routes/movies.js.html @@ -0,0 +1,101 @@ + + + + Code coverage report for VideoStoreAPI/routes/movies.js + + + + + + + +
+
+

+ all files / VideoStoreAPI/routes/ movies.js +

+
+
+ 100% + Statements + 8/8 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 8/8 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +131× +1× +1× +  +  +1× +1× +1× +1× +  +  +1× + 
var express = require('express');
+var router = express.Router();
+var Controller = require('../controllers/movies')
+ 
+ 
+router.get('/', Controller.getMovies)
+router.get('/sort/:column', Controller.subsetMovies)
+router.get('/:title/current', Controller.getRentalsCustomers)
+router.get('/:title/history', Controller.getMoviesHistory)
+ 
+ 
+module.exports = router;
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/VideoStoreAPI/routes/rentals.js.html b/coverage/lcov-report/VideoStoreAPI/routes/rentals.js.html new file mode 100644 index 000000000..15a12de6d --- /dev/null +++ b/coverage/lcov-report/VideoStoreAPI/routes/rentals.js.html @@ -0,0 +1,116 @@ + + + + Code coverage report for VideoStoreAPI/routes/rentals.js + + + + + + + +
+
+

+ all files / VideoStoreAPI/routes/ rentals.js +

+
+
+ 100% + Statements + 9/9 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 9/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +181× +1× +1× +  +1× +1× +1× +  +1× +  +  +1× +  +  +  +  +1× + 
var express = require('express');
+var router = express.Router();
+var Controller = require('../controllers/rentals')
+ 
+router.get('/overdue', Controller.getRentalsOverdue)
+router.get('/:title', Controller.getRentals)
+router.get('/:title/customers', Controller.getRentalsCustomers)
+// can't post from browser URL
+router.get('/:title/check-out/:customerid', Controller.getRentalsCheckOut)
+// must pass rental id, sorry....
+// passing movie titles is UNRELIABLE!
+router.get('/return/:id', Controller.getRentalsReturn)
+ 
+ 
+ 
+ 
+module.exports = router;
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/base.css b/coverage/lcov-report/base.css new file mode 100644 index 000000000..29737bcb0 --- /dev/null +++ b/coverage/lcov-report/base.css @@ -0,0 +1,213 @@ +body, html { + margin:0; padding: 0; + height: 100%; +} +body { + font-family: Helvetica Neue, Helvetica, Arial; + font-size: 14px; + color:#333; +} +.small { font-size: 12px; } +*, *:after, *:before { + -webkit-box-sizing:border-box; + -moz-box-sizing:border-box; + box-sizing:border-box; + } +h1 { font-size: 20px; margin: 0;} +h2 { font-size: 14px; } +pre { + font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; + margin: 0; + padding: 0; + -moz-tab-size: 2; + -o-tab-size: 2; + tab-size: 2; +} +a { color:#0074D9; text-decoration:none; } +a:hover { text-decoration:underline; } +.strong { font-weight: bold; } +.space-top1 { padding: 10px 0 0 0; } +.pad2y { padding: 20px 0; } +.pad1y { padding: 10px 0; } +.pad2x { padding: 0 20px; } +.pad2 { padding: 20px; } +.pad1 { padding: 10px; } +.space-left2 { padding-left:55px; } +.space-right2 { padding-right:20px; } +.center { text-align:center; } +.clearfix { display:block; } +.clearfix:after { + content:''; + display:block; + height:0; + clear:both; + visibility:hidden; + } +.fl { float: left; } +@media only screen and (max-width:640px) { + .col3 { width:100%; max-width:100%; } + .hide-mobile { display:none!important; } +} + +.quiet { + color: #7f7f7f; + color: rgba(0,0,0,0.5); +} +.quiet a { opacity: 0.7; } + +.fraction { + font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; + font-size: 10px; + color: #555; + background: #E8E8E8; + padding: 4px 5px; + border-radius: 3px; + vertical-align: middle; +} + +div.path a:link, div.path a:visited { color: #333; } +table.coverage { + border-collapse: collapse; + margin: 10px 0 0 0; + padding: 0; +} + +table.coverage td { + margin: 0; + padding: 0; + vertical-align: top; +} +table.coverage td.line-count { + text-align: right; + padding: 0 5px 0 20px; +} +table.coverage td.line-coverage { + text-align: right; + padding-right: 10px; + min-width:20px; +} + +table.coverage td span.cline-any { + display: inline-block; + padding: 0 5px; + width: 100%; +} +.missing-if-branch { + display: inline-block; + margin-right: 5px; + border-radius: 3px; + position: relative; + padding: 0 4px; + background: #333; + color: yellow; +} + +.skip-if-branch { + display: none; + margin-right: 10px; + position: relative; + padding: 0 4px; + background: #ccc; + color: white; +} +.missing-if-branch .typ, .skip-if-branch .typ { + color: inherit !important; +} +.coverage-summary { + border-collapse: collapse; + width: 100%; +} +.coverage-summary tr { border-bottom: 1px solid #bbb; } +.keyline-all { border: 1px solid #ddd; } +.coverage-summary td, .coverage-summary th { padding: 10px; } +.coverage-summary tbody { border: 1px solid #bbb; } +.coverage-summary td { border-right: 1px solid #bbb; } +.coverage-summary td:last-child { border-right: none; } +.coverage-summary th { + text-align: left; + font-weight: normal; + white-space: nowrap; +} +.coverage-summary th.file { border-right: none !important; } +.coverage-summary th.pct { } +.coverage-summary th.pic, +.coverage-summary th.abs, +.coverage-summary td.pct, +.coverage-summary td.abs { text-align: right; } +.coverage-summary td.file { white-space: nowrap; } +.coverage-summary td.pic { min-width: 120px !important; } +.coverage-summary tfoot td { } + +.coverage-summary .sorter { + height: 10px; + width: 7px; + display: inline-block; + margin-left: 0.5em; + background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; +} +.coverage-summary .sorted .sorter { + background-position: 0 -20px; +} +.coverage-summary .sorted-desc .sorter { + background-position: 0 -10px; +} +.status-line { height: 10px; } +/* dark red */ +.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } +.low .chart { border:1px solid #C21F39 } +/* medium red */ +.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } +/* light red */ +.low, .cline-no { background:#FCE1E5 } +/* light green */ +.high, .cline-yes { background:rgb(230,245,208) } +/* medium green */ +.cstat-yes { background:rgb(161,215,106) } +/* dark green */ +.status-line.high, .high .cover-fill { background:rgb(77,146,33) } +.high .chart { border:1px solid rgb(77,146,33) } +/* dark yellow (gold) */ +.medium .chart { border:1px solid #f9cd0b; } +.status-line.medium, .medium .cover-fill { background: #f9cd0b; } +/* light yellow */ +.medium { background: #fff4c2; } +/* light gray */ +span.cline-neutral { background: #eaeaea; } + +.cbranch-no { background: yellow !important; color: #111; } + +.cstat-skip { background: #ddd; color: #111; } +.fstat-skip { background: #ddd; color: #111 !important; } +.cbranch-skip { background: #ddd !important; color: #111; } + + +.cover-fill, .cover-empty { + display:inline-block; + height: 12px; +} +.chart { + line-height: 0; +} +.cover-empty { + background: white; +} +.cover-full { + border-right: none !important; +} +pre.prettyprint { + border: none !important; + padding: 0 !important; + margin: 0 !important; +} +.com { color: #999 !important; } +.ignore-none { color: #999; font-weight: normal; } + +.wrapper { + min-height: 100%; + height: auto !important; + height: 100%; + margin: 0 auto -48px; +} +.footer, .push { + height: 48px; +} diff --git a/coverage/lcov-report/index.html b/coverage/lcov-report/index.html new file mode 100644 index 000000000..c4c224cdb --- /dev/null +++ b/coverage/lcov-report/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for All files + + + + + + + +
+
+

+ / +

+
+
+ 39.43% + Statements + 97/246 +
+
+ 1.22% + Branches + 1/82 +
+
+ 0% + Functions + 0/66 +
+
+ 39.43% + Lines + 97/246 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
VideoStoreAPI/
78.95%30/3816.67%1/60%0/378.95%30/38
VideoStoreAPI/controllers/
16.22%12/740%0/240%0/2616.22%12/74
VideoStoreAPI/models/
24.51%25/1020%0/520%0/3524.51%25/102
VideoStoreAPI/routes/
93.75%30/32100%0/00%0/293.75%30/32
+
+
+ + + + + + + diff --git a/coverage/lcov-report/prettify.css b/coverage/lcov-report/prettify.css new file mode 100644 index 000000000..b317a7cda --- /dev/null +++ b/coverage/lcov-report/prettify.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/coverage/lcov-report/prettify.js b/coverage/lcov-report/prettify.js new file mode 100644 index 000000000..ef51e0386 --- /dev/null +++ b/coverage/lcov-report/prettify.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/coverage/lcov-report/sort-arrow-sprite.png b/coverage/lcov-report/sort-arrow-sprite.png new file mode 100644 index 0000000000000000000000000000000000000000..03f704a609c6fd0dbfdac63466a7d7c958b5cbf3 GIT binary patch literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^>_9Bd!3HEZxJ@+%Qj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS>Jii$m5978H@?Fn+^JD|Y9yzj{W`447Gxa{7*dM7nnnD-Lb z6^}Hx2)'; + } + } + return cols; + } + // attaches a data attribute to every tr element with an object + // of data values keyed by column name + function loadRowData(tableRow) { + var tableCols = tableRow.querySelectorAll('td'), + colNode, + col, + data = {}, + i, + val; + for (i = 0; i < tableCols.length; i += 1) { + colNode = tableCols[i]; + col = cols[i]; + val = colNode.getAttribute('data-value'); + if (col.type === 'number') { + val = Number(val); + } + data[col.key] = val; + } + return data; + } + // loads all row data + function loadData() { + var rows = getTableBody().querySelectorAll('tr'), + i; + + for (i = 0; i < rows.length; i += 1) { + rows[i].data = loadRowData(rows[i]); + } + } + // sorts the table using the data for the ith column + function sortByIndex(index, desc) { + var key = cols[index].key, + sorter = function (a, b) { + a = a.data[key]; + b = b.data[key]; + return a < b ? -1 : a > b ? 1 : 0; + }, + finalSorter = sorter, + tableBody = document.querySelector('.coverage-summary tbody'), + rowNodes = tableBody.querySelectorAll('tr'), + rows = [], + i; + + if (desc) { + finalSorter = function (a, b) { + return -1 * sorter(a, b); + }; + } + + for (i = 0; i < rowNodes.length; i += 1) { + rows.push(rowNodes[i]); + tableBody.removeChild(rowNodes[i]); + } + + rows.sort(finalSorter); + + for (i = 0; i < rows.length; i += 1) { + tableBody.appendChild(rows[i]); + } + } + // removes sort indicators for current column being sorted + function removeSortIndicators() { + var col = getNthColumn(currentSort.index), + cls = col.className; + + cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); + col.className = cls; + } + // adds sort indicators for current column being sorted + function addSortIndicators() { + getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted'; + } + // adds event listeners for all sorter widgets + function enableUI() { + var i, + el, + ithSorter = function ithSorter(i) { + var col = cols[i]; + + return function () { + var desc = col.defaultDescSort; + + if (currentSort.index === i) { + desc = !currentSort.desc; + } + sortByIndex(i, desc); + removeSortIndicators(); + currentSort.index = i; + currentSort.desc = desc; + addSortIndicators(); + }; + }; + for (i =0 ; i < cols.length; i += 1) { + if (cols[i].sortable) { + // add the click event handler on the th so users + // dont have to click on those tiny arrows + el = getNthColumn(i).querySelector('.sorter').parentElement; + if (el.addEventListener) { + el.addEventListener('click', ithSorter(i)); + } else { + el.attachEvent('onclick', ithSorter(i)); + } + } + } + } + // adds sorting functionality to the UI + return function () { + if (!getTable()) { + return; + } + cols = loadColumns(); + loadData(cols); + addSortIndicators(); + enableUI(); + }; +})(); + +window.addEventListener('load', addSorting); diff --git a/coverage/lcov.info b/coverage/lcov.info new file mode 100644 index 000000000..096badf70 --- /dev/null +++ b/coverage/lcov.info @@ -0,0 +1,559 @@ +TN: +SF:/Users/leahpetersen/C5/projects/VideoStoreAPI/app.js +FN:50,(anonymous_1) +FN:61,(anonymous_2) +FN:72,(anonymous_3) +FNF:3 +FNH:0 +FNDA:0,(anonymous_1) +FNDA:0,(anonymous_2) +FNDA:0,(anonymous_3) +DA:1,1 +DA:2,1 +DA:3,1 +DA:4,1 +DA:5,1 +DA:6,1 +DA:7,1 +DA:8,1 +DA:11,1 +DA:16,1 +DA:19,1 +DA:23,1 +DA:24,1 +DA:28,1 +DA:31,1 +DA:32,1 +DA:33,1 +DA:34,1 +DA:36,1 +DA:37,1 +DA:38,1 +DA:39,1 +DA:43,1 +DA:44,1 +DA:45,1 +DA:46,1 +DA:50,1 +DA:51,0 +DA:52,0 +DA:53,0 +DA:60,1 +DA:61,0 +DA:62,0 +DA:63,0 +DA:72,1 +DA:73,0 +DA:74,0 +DA:81,1 +LF:38 +LH:30 +BRDA:60,1,0,0 +BRDA:60,1,1,1 +BRDA:62,2,0,0 +BRDA:62,2,1,0 +BRDA:73,3,0,0 +BRDA:73,3,1,0 +BRF:6 +BRH:1 +end_of_record +TN: +SF:/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/index.js +FN:6,(anonymous_1) +FN:10,(anonymous_2) +FNF:2 +FNH:0 +FNDA:0,(anonymous_1) +FNDA:0,(anonymous_2) +DA:1,1 +DA:2,1 +DA:6,1 +DA:7,0 +DA:10,1 +DA:11,0 +DA:14,1 +LF:7 +LH:5 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/customers.js +FNF:0 +FNH:0 +DA:1,1 +DA:2,1 +DA:3,1 +DA:6,1 +DA:7,1 +DA:8,1 +DA:9,1 +DA:12,1 +LF:8 +LH:8 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/customers.js +FN:6,(anonymous_1) +FN:7,(anonymous_2) +FN:18,(anonymous_3) +FN:19,(anonymous_4) +FN:30,(anonymous_5) +FN:31,(anonymous_6) +FN:41,(anonymous_7) +FN:42,(anonymous_8) +FNF:8 +FNH:0 +FNDA:0,(anonymous_1) +FNDA:0,(anonymous_2) +FNDA:0,(anonymous_3) +FNDA:0,(anonymous_4) +FNDA:0,(anonymous_5) +FNDA:0,(anonymous_6) +FNDA:0,(anonymous_7) +FNDA:0,(anonymous_8) +DA:1,1 +DA:2,1 +DA:5,1 +DA:7,0 +DA:8,0 +DA:9,0 +DA:10,0 +DA:12,0 +DA:19,0 +DA:20,0 +DA:21,0 +DA:22,0 +DA:24,0 +DA:31,0 +DA:32,0 +DA:33,0 +DA:34,0 +DA:36,0 +DA:42,0 +DA:43,0 +DA:44,0 +DA:45,0 +DA:47,0 +DA:52,1 +LF:24 +LH:4 +BRDA:8,1,0,0 +BRDA:8,1,1,0 +BRDA:20,2,0,0 +BRDA:20,2,1,0 +BRDA:32,3,0,0 +BRDA:32,3,1,0 +BRDA:43,4,0,0 +BRDA:43,4,1,0 +BRF:8 +BRH:0 +end_of_record +TN: +SF:/Users/leahpetersen/C5/projects/VideoStoreAPI/models/customers_model.js +FN:4,(anonymous_1) +FN:8,(anonymous_2) +FN:9,(anonymous_3) +FN:13,(anonymous_4) +FN:20,(anonymous_5) +FN:26,(anonymous_6) +FN:30,(anonymous_7) +FNF:7 +FNH:0 +FNDA:0,(anonymous_1) +FNDA:0,(anonymous_2) +FNDA:0,(anonymous_3) +FNDA:0,(anonymous_4) +FNDA:0,(anonymous_5) +FNDA:0,(anonymous_6) +FNDA:0,(anonymous_7) +DA:1,1 +DA:2,1 +DA:4,1 +DA:5,0 +DA:8,1 +DA:9,0 +DA:10,0 +DA:11,0 +DA:13,0 +DA:14,0 +DA:20,1 +DA:22,0 +DA:27,0 +DA:28,0 +DA:30,0 +DA:31,0 +DA:37,1 +LF:17 +LH:6 +BRDA:10,1,0,0 +BRDA:10,1,1,0 +BRDA:10,2,0,0 +BRDA:10,2,1,0 +BRDA:11,3,0,0 +BRDA:11,3,1,0 +BRDA:27,4,0,0 +BRDA:27,4,1,0 +BRDA:27,5,0,0 +BRDA:27,5,1,0 +BRDA:28,6,0,0 +BRDA:28,6,1,0 +BRF:12 +BRH:0 +end_of_record +TN: +SF:/Users/leahpetersen/C5/projects/VideoStoreAPI/models/rentals_model.js +FN:4,(anonymous_1) +FN:14,(anonymous_2) +FN:15,(anonymous_3) +FN:24,(anonymous_4) +FN:25,(anonymous_5) +FN:34,(anonymous_6) +FN:35,(anonymous_7) +FN:44,(anonymous_8) +FN:45,(anonymous_9) +FN:54,(anonymous_10) +FN:55,(anonymous_11) +FN:64,(anonymous_12) +FN:66,(anonymous_13) +FN:74,(anonymous_14) +FN:79,(anonymous_15) +FN:88,(anonymous_16) +FN:93,(anonymous_17) +FN:101,(anonymous_18) +FN:119,(anonymous_19) +FNF:19 +FNH:0 +FNDA:0,(anonymous_1) +FNDA:0,(anonymous_2) +FNDA:0,(anonymous_3) +FNDA:0,(anonymous_4) +FNDA:0,(anonymous_5) +FNDA:0,(anonymous_6) +FNDA:0,(anonymous_7) +FNDA:0,(anonymous_8) +FNDA:0,(anonymous_9) +FNDA:0,(anonymous_10) +FNDA:0,(anonymous_11) +FNDA:0,(anonymous_12) +FNDA:0,(anonymous_13) +FNDA:0,(anonymous_14) +FNDA:0,(anonymous_15) +FNDA:0,(anonymous_16) +FNDA:0,(anonymous_17) +FNDA:0,(anonymous_18) +FNDA:0,(anonymous_19) +DA:1,1 +DA:2,1 +DA:4,1 +DA:5,0 +DA:6,0 +DA:7,0 +DA:8,0 +DA:9,0 +DA:10,0 +DA:14,1 +DA:15,0 +DA:16,0 +DA:17,0 +DA:19,0 +DA:24,1 +DA:25,0 +DA:26,0 +DA:27,0 +DA:29,0 +DA:34,1 +DA:35,0 +DA:36,0 +DA:37,0 +DA:39,0 +DA:44,1 +DA:45,0 +DA:46,0 +DA:47,0 +DA:49,0 +DA:54,1 +DA:55,0 +DA:56,0 +DA:57,0 +DA:59,0 +DA:64,1 +DA:65,0 +DA:66,0 +DA:67,0 +DA:68,0 +DA:70,0 +DA:74,1 +DA:75,0 +DA:80,0 +DA:81,0 +DA:83,0 +DA:88,1 +DA:90,0 +DA:94,0 +DA:95,0 +DA:96,0 +DA:97,0 +DA:101,0 +DA:102,0 +DA:103,0 +DA:107,0 +DA:108,0 +DA:109,0 +DA:112,0 +DA:120,0 +DA:121,0 +DA:124,0 +DA:130,1 +LF:62 +LH:12 +BRDA:16,1,0,0 +BRDA:16,1,1,0 +BRDA:26,2,0,0 +BRDA:26,2,1,0 +BRDA:36,3,0,0 +BRDA:36,3,1,0 +BRDA:46,4,0,0 +BRDA:46,4,1,0 +BRDA:56,5,0,0 +BRDA:56,5,1,0 +BRDA:67,6,0,0 +BRDA:67,6,1,0 +BRDA:80,7,0,0 +BRDA:80,7,1,0 +BRDA:94,8,0,0 +BRDA:94,8,1,0 +BRDA:96,9,0,0 +BRDA:96,9,1,0 +BRDA:102,10,0,0 +BRDA:102,10,1,0 +BRDA:120,11,0,0 +BRDA:120,11,1,0 +BRF:22 +BRH:0 +end_of_record +TN: +SF:/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/movies.js +FNF:0 +FNH:0 +DA:1,1 +DA:2,1 +DA:3,1 +DA:6,1 +DA:7,1 +DA:8,1 +DA:9,1 +DA:12,1 +LF:8 +LH:8 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/movies.js +FN:6,(anonymous_1) +FN:7,(anonymous_2) +FN:17,(anonymous_3) +FN:18,(anonymous_4) +FN:29,(anonymous_5) +FN:30,(anonymous_6) +FN:40,(anonymous_7) +FNF:7 +FNH:0 +FNDA:0,(anonymous_1) +FNDA:0,(anonymous_2) +FNDA:0,(anonymous_3) +FNDA:0,(anonymous_4) +FNDA:0,(anonymous_5) +FNDA:0,(anonymous_6) +FNDA:0,(anonymous_7) +DA:1,1 +DA:2,1 +DA:5,1 +DA:7,0 +DA:8,0 +DA:9,0 +DA:10,0 +DA:12,0 +DA:18,0 +DA:19,0 +DA:20,0 +DA:21,0 +DA:23,0 +DA:30,0 +DA:31,0 +DA:32,0 +DA:33,0 +DA:35,0 +DA:45,1 +LF:19 +LH:4 +BRDA:8,1,0,0 +BRDA:8,1,1,0 +BRDA:19,2,0,0 +BRDA:19,2,1,0 +BRDA:31,3,0,0 +BRDA:31,3,1,0 +BRF:6 +BRH:0 +end_of_record +TN: +SF:/Users/leahpetersen/C5/projects/VideoStoreAPI/models/movies_model.js +FN:4,(anonymous_1) +FN:9,(anonymous_2) +FN:10,(anonymous_3) +FN:14,(anonymous_4) +FN:21,(anonymous_5) +FN:22,(anonymous_6) +FN:33,(anonymous_7) +FN:39,(anonymous_8) +FN:43,(anonymous_9) +FNF:9 +FNH:0 +FNDA:0,(anonymous_1) +FNDA:0,(anonymous_2) +FNDA:0,(anonymous_3) +FNDA:0,(anonymous_4) +FNDA:0,(anonymous_5) +FNDA:0,(anonymous_6) +FNDA:0,(anonymous_7) +FNDA:0,(anonymous_8) +FNDA:0,(anonymous_9) +DA:1,1 +DA:2,1 +DA:4,1 +DA:5,0 +DA:6,0 +DA:9,1 +DA:10,0 +DA:11,0 +DA:12,0 +DA:14,0 +DA:15,0 +DA:21,1 +DA:22,0 +DA:24,0 +DA:26,0 +DA:28,0 +DA:33,1 +DA:35,0 +DA:40,0 +DA:41,0 +DA:43,0 +DA:44,0 +DA:50,1 +LF:23 +LH:7 +BRDA:11,1,0,0 +BRDA:11,1,1,0 +BRDA:11,2,0,0 +BRDA:11,2,1,0 +BRDA:12,3,0,0 +BRDA:12,3,1,0 +BRDA:24,4,0,0 +BRDA:24,4,1,0 +BRDA:24,5,0,0 +BRDA:24,5,1,0 +BRDA:26,6,0,0 +BRDA:26,6,1,0 +BRDA:40,7,0,0 +BRDA:40,7,1,0 +BRDA:40,8,0,0 +BRDA:40,8,1,0 +BRDA:41,9,0,0 +BRDA:41,9,1,0 +BRF:18 +BRH:0 +end_of_record +TN: +SF:/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/rentals.js +FNF:0 +FNH:0 +DA:1,1 +DA:2,1 +DA:3,1 +DA:5,1 +DA:6,1 +DA:7,1 +DA:9,1 +DA:12,1 +DA:17,1 +LF:9 +LH:9 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/rentals.js +FN:5,(anonymous_1) +FN:6,(anonymous_2) +FN:11,(anonymous_3) +FN:26,(anonymous_4) +FN:27,(anonymous_5) +FN:37,(anonymous_6) +FN:38,(anonymous_7) +FN:48,(anonymous_8) +FN:49,(anonymous_9) +FN:60,(anonymous_10) +FN:61,(anonymous_11) +FNF:11 +FNH:0 +FNDA:0,(anonymous_1) +FNDA:0,(anonymous_2) +FNDA:0,(anonymous_3) +FNDA:0,(anonymous_4) +FNDA:0,(anonymous_5) +FNDA:0,(anonymous_6) +FNDA:0,(anonymous_7) +FNDA:0,(anonymous_8) +FNDA:0,(anonymous_9) +FNDA:0,(anonymous_10) +FNDA:0,(anonymous_11) +DA:1,1 +DA:2,1 +DA:4,1 +DA:6,0 +DA:7,0 +DA:8,0 +DA:9,0 +DA:11,0 +DA:12,0 +DA:19,0 +DA:27,0 +DA:28,0 +DA:29,0 +DA:30,0 +DA:32,0 +DA:38,0 +DA:39,0 +DA:40,0 +DA:41,0 +DA:43,0 +DA:49,0 +DA:50,0 +DA:51,0 +DA:52,0 +DA:54,0 +DA:61,0 +DA:62,0 +DA:63,0 +DA:64,0 +DA:66,0 +DA:72,1 +LF:31 +LH:4 +BRDA:7,1,0,0 +BRDA:7,1,1,0 +BRDA:28,2,0,0 +BRDA:28,2,1,0 +BRDA:39,3,0,0 +BRDA:39,3,1,0 +BRDA:50,4,0,0 +BRDA:50,4,1,0 +BRDA:62,5,0,0 +BRDA:62,5,1,0 +BRF:10 +BRH:0 +end_of_record diff --git a/package.json b/package.json index 75917ce6b..02f08f82c 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "db:schema-test": "node tasks/load_schema.js video_store_test", "db:seed-test": "node tasks/seed.js video_store_test", "reset-test": "npm run db:drop-test; npm run db:create-test; npm run db:schema-test; npm run db:seed-test;", - "test": "clear; ./node_modules/.bin/jasmine-node --captureExceptions --verbose spec/" + "test": "clear; ./node_modules/.bin/istanbul cover -x 'spec/**/*' -- ./node_modules/.bin/jasmine-node --captureExceptions --verbose spec/" }, "dependencies": { "body-parser": "~1.13.2", diff --git a/spec/controllers/customers.spec.js b/spec/controllers/customers.spec.js index ef4fc5ec5..6e2f6fab0 100644 --- a/spec/controllers/customers.spec.js +++ b/spec/controllers/customers.spec.js @@ -1,7 +1,6 @@ var request = require('request'); var base_url = "http://localhost:3000/" var route = "customers/" -// var app = require('../../app.js'); describe("Endpoints under /customers", function() { diff --git a/spec/controllers/index.spec.js b/spec/controllers/index.spec.js index 697d553b1..4c1b47e97 100644 --- a/spec/controllers/index.spec.js +++ b/spec/controllers/index.spec.js @@ -1,29 +1,11 @@ var request = require('request') var base_url = "http://localhost:3000/" -// describe("Endpoint at /", function () { -// it('responds with a 200 status code', function (done) { -// request.get(base_url, function(error, response, body) { -// expect(response.statusCode).toEqual(200) -// done() -// }) -// }) - -// describe("the returned json data", function() { -// it('has the right keys', function(done) { -// request.get(base_url, function(error, response, body) { -// var data = JSON.parse(body) -// expect(Object.keys(data)).toEqual(['whatevs']) -// done() -// }) -// }) - -// it('has the right values for the keys', function(done) { -// request.get(base_url, function(error, response, body) { -// var data = JSON.parse(body) -// expect(data.whatevs).toEqual('whatevs!!!') -// done() -// }) -// }) -// }) -// }) +describe("Endpoint at /", function () { + it('responds with a 200 status code', function (done) { + request.get(base_url, function(error, response, body) { + expect(response.statusCode).toEqual(200) + done() + }) + }) +}) diff --git a/spec/controllers/movies.spec.js b/spec/controllers/movies.spec.js index a4fbf0be2..73b5b4eff 100644 --- a/spec/controllers/movies.spec.js +++ b/spec/controllers/movies.spec.js @@ -3,14 +3,11 @@ var base_url = "http://localhost:3000/" var route = "movies/" -// describe("Endpoints under /movies", function() { -// it('responds with a 200 status code', function (done) { -// request.get(base_url + route, function(error, response, body) { -// expect(response.statusCode).toEqual(200) -// done() -// }) -// }); - - - -// }); \ No newline at end of file +describe("Endpoints under /movies", function() { + it('responds with a 200 status code', function (done) { + request.get(base_url + route, function(error, response, body) { + expect(response.statusCode).toEqual(200) + done() + }) + }); +}); \ No newline at end of file diff --git a/spec/controllers/rentals.spec.js b/spec/controllers/rentals.spec.js index d550ac692..828753739 100644 --- a/spec/controllers/rentals.spec.js +++ b/spec/controllers/rentals.spec.js @@ -3,14 +3,11 @@ var base_url = "http://localhost:3000/" var route = "rentals/" -// describe("Endpoints under /rentals", function() { -// it('responds with a 200 status code', function (done) { -// request.get(base_url + route, function(error, response, body) { -// expect(response.statusCode).toEqual(200) -// done() -// }) -// }); - - - -// }); \ No newline at end of file +describe("Endpoints under /rentals", function() { + it('/overdue responds with a 200 status code', function (done) { + request.get(base_url + route + "/overdue", function(error, response, body) { + expect(response.statusCode).toEqual(200) + done() + }) + }); +}); \ No newline at end of file diff --git a/spec/models/customers_model.spec.js b/spec/models/customers_model.spec.js index 8b2362d5f..e53f09d89 100644 --- a/spec/models/customers_model.spec.js +++ b/spec/models/customers_model.spec.js @@ -1,6 +1,5 @@ var app = require("../../app"); var db = app.get("db"); - var Account = require('../../models/customers_model') diff --git a/spec/models/movies_model.spec.js b/spec/models/movies_model.spec.js index 22a5fb3e1..3013f1f56 100644 --- a/spec/models/movies_model.spec.js +++ b/spec/models/movies_model.spec.js @@ -1,6 +1,5 @@ var app = require("../../app"); var db = app.get("db"); - var Account = require('../../models/movies_model') diff --git a/spec/models/rentals_model.spec.js b/spec/models/rentals_model.spec.js index b330b2f41..7d2a62512 100644 --- a/spec/models/rentals_model.spec.js +++ b/spec/models/rentals_model.spec.js @@ -1,6 +1,5 @@ var app = require("../../app"); var db = app.get("db"); - var Account = require('../../models/rentals_model') From 971e97144fc537ff194dc777a5ebf2732b878722 Mon Sep 17 00:00:00 2001 From: Leah Date: Thu, 23 Jun 2016 11:22:58 -0700 Subject: [PATCH 49/69] added test for customer model all method --- controllers/customers.js | 7 +- coverage/coverage.json | 2 +- .../lcov-report/VideoStoreAPI/app.js.html | 2 +- .../controllers/customers.js.html | 13 ++-- .../VideoStoreAPI/controllers/index.html | 2 +- .../VideoStoreAPI/controllers/movies.js.html | 2 +- .../VideoStoreAPI/controllers/rentals.js.html | 2 +- coverage/lcov-report/VideoStoreAPI/index.html | 2 +- .../models/customers_model.js.html | 44 +++++------ .../VideoStoreAPI/models/index.html | 38 +++++----- .../VideoStoreAPI/models/movies_model.js.html | 2 +- .../models/rentals_model.js.html | 2 +- .../VideoStoreAPI/routes/customers.js.html | 2 +- .../VideoStoreAPI/routes/index.html | 2 +- .../VideoStoreAPI/routes/index.js.html | 2 +- .../VideoStoreAPI/routes/movies.js.html | 2 +- .../VideoStoreAPI/routes/rentals.js.html | 2 +- coverage/lcov-report/index.html | 36 ++++----- coverage/lcov.info | 68 ++++++++--------- npm-debug.log | 49 ++++++++++++ spec/models/customers_model.spec.js | 74 ++++++++----------- 21 files changed, 195 insertions(+), 160 deletions(-) create mode 100644 npm-debug.log diff --git a/controllers/customers.js b/controllers/customers.js index 37a3535cf..4deaf461d 100644 --- a/controllers/customers.js +++ b/controllers/customers.js @@ -12,7 +12,6 @@ var CustomersController = { res.json(customers) } }) - }, // customer id, sort column, offest ????? subsetCustomers: function(req, res) { @@ -21,7 +20,7 @@ var CustomersController = { var err = new Error("No such data"); err.status = 404; } else { - res.json(data) + res.json(data) } }) }, @@ -33,7 +32,7 @@ var CustomersController = { var err = new Error("No such data"); err.status = 404; } else { - res.json(data) + res.json(data) } }) }, @@ -44,7 +43,7 @@ var CustomersController = { var err = new Error("No such data"); err.status = 404; } else { - res.json(data) + res.json(data) } }) } diff --git a/coverage/coverage.json b/coverage/coverage.json index 89e407e35..42050bfda 100644 --- a/coverage/coverage.json +++ b/coverage/coverage.json @@ -1 +1 @@ -{"/Users/leahpetersen/C5/projects/VideoStoreAPI/app.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/app.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":1,"19":1,"20":1,"21":1,"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":0,"29":0,"30":0,"31":1,"32":0,"33":0,"34":0,"35":1,"36":0,"37":0,"38":1},"b":{"1":[0,1],"2":[0,0],"3":[0,0]},"f":{"1":0,"2":0,"3":0},"fnMap":{"1":{"name":"(anonymous_1)","line":50,"loc":{"start":{"line":50,"column":8},"end":{"line":50,"column":33}}},"2":{"name":"(anonymous_2)","line":61,"loc":{"start":{"line":61,"column":10},"end":{"line":61,"column":40}}},"3":{"name":"(anonymous_3)","line":72,"loc":{"start":{"line":72,"column":8},"end":{"line":72,"column":38}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":27}},"3":{"start":{"line":3,"column":0},"end":{"line":3,"column":39}},"4":{"start":{"line":4,"column":0},"end":{"line":4,"column":31}},"5":{"start":{"line":5,"column":0},"end":{"line":5,"column":44}},"6":{"start":{"line":6,"column":0},"end":{"line":6,"column":40}},"7":{"start":{"line":7,"column":0},"end":{"line":7,"column":33}},"8":{"start":{"line":8,"column":0},"end":{"line":8,"column":37}},"9":{"start":{"line":11,"column":0},"end":{"line":11,"column":76}},"10":{"start":{"line":16,"column":0},"end":{"line":16,"column":80}},"11":{"start":{"line":19,"column":0},"end":{"line":19,"column":31}},"12":{"start":{"line":23,"column":0},"end":{"line":23,"column":48}},"13":{"start":{"line":24,"column":0},"end":{"line":24,"column":31}},"14":{"start":{"line":28,"column":0},"end":{"line":28,"column":23}},"15":{"start":{"line":31,"column":0},"end":{"line":31,"column":27}},"16":{"start":{"line":32,"column":0},"end":{"line":32,"column":52}},"17":{"start":{"line":33,"column":0},"end":{"line":33,"column":24}},"18":{"start":{"line":34,"column":0},"end":{"line":34,"column":56}},"19":{"start":{"line":36,"column":0},"end":{"line":36,"column":42}},"20":{"start":{"line":37,"column":0},"end":{"line":37,"column":46}},"21":{"start":{"line":38,"column":0},"end":{"line":38,"column":43}},"22":{"start":{"line":39,"column":0},"end":{"line":39,"column":44}},"23":{"start":{"line":43,"column":0},"end":{"line":43,"column":21}},"24":{"start":{"line":44,"column":0},"end":{"line":44,"column":33}},"25":{"start":{"line":45,"column":0},"end":{"line":45,"column":27}},"26":{"start":{"line":46,"column":0},"end":{"line":46,"column":29}},"27":{"start":{"line":50,"column":0},"end":{"line":54,"column":3}},"28":{"start":{"line":51,"column":2},"end":{"line":51,"column":35}},"29":{"start":{"line":52,"column":2},"end":{"line":52,"column":19}},"30":{"start":{"line":53,"column":2},"end":{"line":53,"column":12}},"31":{"start":{"line":60,"column":0},"end":{"line":68,"column":1}},"32":{"start":{"line":61,"column":2},"end":{"line":67,"column":5}},"33":{"start":{"line":62,"column":4},"end":{"line":62,"column":34}},"34":{"start":{"line":63,"column":4},"end":{"line":66,"column":7}},"35":{"start":{"line":72,"column":0},"end":{"line":78,"column":3}},"36":{"start":{"line":73,"column":2},"end":{"line":73,"column":32}},"37":{"start":{"line":74,"column":2},"end":{"line":77,"column":5}},"38":{"start":{"line":81,"column":0},"end":{"line":81,"column":21}}},"branchMap":{"1":{"line":60,"type":"if","locations":[{"start":{"line":60,"column":0},"end":{"line":60,"column":0}},{"start":{"line":60,"column":0},"end":{"line":60,"column":0}}]},"2":{"line":62,"type":"binary-expr","locations":[{"start":{"line":62,"column":15},"end":{"line":62,"column":25}},{"start":{"line":62,"column":29},"end":{"line":62,"column":32}}]},"3":{"line":73,"type":"binary-expr","locations":[{"start":{"line":73,"column":13},"end":{"line":73,"column":23}},{"start":{"line":73,"column":27},"end":{"line":73,"column":30}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/index.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/index.js","s":{"1":1,"2":1,"3":1,"4":0,"5":1,"6":0,"7":1},"b":{},"f":{"1":0,"2":0},"fnMap":{"1":{"name":"(anonymous_1)","line":6,"loc":{"start":{"line":6,"column":16},"end":{"line":6,"column":41}}},"2":{"name":"(anonymous_2)","line":10,"loc":{"start":{"line":10,"column":20},"end":{"line":10,"column":45}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}},"3":{"start":{"line":6,"column":0},"end":{"line":8,"column":3}},"4":{"start":{"line":7,"column":2},"end":{"line":7,"column":40}},"5":{"start":{"line":10,"column":0},"end":{"line":12,"column":3}},"6":{"start":{"line":11,"column":2},"end":{"line":11,"column":49}},"7":{"start":{"line":14,"column":0},"end":{"line":14,"column":24}}},"branchMap":{}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/customers.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/customers.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1},"b":{},"f":{},"fnMap":{},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}},"3":{"start":{"line":3,"column":0},"end":{"line":3,"column":52}},"4":{"start":{"line":6,"column":0},"end":{"line":6,"column":40}},"5":{"start":{"line":7,"column":0},"end":{"line":7,"column":55}},"6":{"start":{"line":8,"column":0},"end":{"line":8,"column":67}},"7":{"start":{"line":9,"column":0},"end":{"line":9,"column":67}},"8":{"start":{"line":12,"column":0},"end":{"line":12,"column":24}}},"branchMap":{}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/customers.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/customers.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0},"fnMap":{"1":{"name":"(anonymous_1)","line":6,"loc":{"start":{"line":6,"column":15},"end":{"line":6,"column":34}}},"2":{"name":"(anonymous_2)","line":7,"loc":{"start":{"line":7,"column":15},"end":{"line":7,"column":42}}},"3":{"name":"(anonymous_3)","line":18,"loc":{"start":{"line":18,"column":18},"end":{"line":18,"column":37}}},"4":{"name":"(anonymous_4)","line":19,"loc":{"start":{"line":19,"column":61},"end":{"line":19,"column":83}}},"5":{"name":"(anonymous_5)","line":30,"loc":{"start":{"line":30,"column":22},"end":{"line":30,"column":41}}},"6":{"name":"(anonymous_6)","line":31,"loc":{"start":{"line":31,"column":51},"end":{"line":31,"column":73}}},"7":{"name":"(anonymous_7)","line":41,"loc":{"start":{"line":41,"column":22},"end":{"line":41,"column":41}}},"8":{"name":"(anonymous_8)","line":42,"loc":{"start":{"line":42,"column":48},"end":{"line":42,"column":70}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":48}},"3":{"start":{"line":5,"column":0},"end":{"line":51,"column":1}},"4":{"start":{"line":7,"column":2},"end":{"line":14,"column":4}},"5":{"start":{"line":8,"column":3},"end":{"line":13,"column":4}},"6":{"start":{"line":9,"column":4},"end":{"line":9,"column":76}},"7":{"start":{"line":10,"column":4},"end":{"line":10,"column":21}},"8":{"start":{"line":12,"column":4},"end":{"line":12,"column":23}},"9":{"start":{"line":19,"column":2},"end":{"line":26,"column":4}},"10":{"start":{"line":20,"column":3},"end":{"line":25,"column":4}},"11":{"start":{"line":21,"column":4},"end":{"line":21,"column":40}},"12":{"start":{"line":22,"column":4},"end":{"line":22,"column":21}},"13":{"start":{"line":24,"column":5},"end":{"line":24,"column":19}},"14":{"start":{"line":31,"column":2},"end":{"line":38,"column":4}},"15":{"start":{"line":32,"column":3},"end":{"line":37,"column":4}},"16":{"start":{"line":33,"column":4},"end":{"line":33,"column":40}},"17":{"start":{"line":34,"column":4},"end":{"line":34,"column":21}},"18":{"start":{"line":36,"column":5},"end":{"line":36,"column":19}},"19":{"start":{"line":42,"column":2},"end":{"line":49,"column":4}},"20":{"start":{"line":43,"column":3},"end":{"line":48,"column":4}},"21":{"start":{"line":44,"column":4},"end":{"line":44,"column":40}},"22":{"start":{"line":45,"column":4},"end":{"line":45,"column":21}},"23":{"start":{"line":47,"column":5},"end":{"line":47,"column":19}},"24":{"start":{"line":52,"column":0},"end":{"line":52,"column":36}}},"branchMap":{"1":{"line":8,"type":"if","locations":[{"start":{"line":8,"column":3},"end":{"line":8,"column":3}},{"start":{"line":8,"column":3},"end":{"line":8,"column":3}}]},"2":{"line":20,"type":"if","locations":[{"start":{"line":20,"column":3},"end":{"line":20,"column":3}},{"start":{"line":20,"column":3},"end":{"line":20,"column":3}}]},"3":{"line":32,"type":"if","locations":[{"start":{"line":32,"column":3},"end":{"line":32,"column":3}},{"start":{"line":32,"column":3},"end":{"line":32,"column":3}}]},"4":{"line":43,"type":"if","locations":[{"start":{"line":43,"column":3},"end":{"line":43,"column":3}},{"start":{"line":43,"column":3},"end":{"line":43,"column":3}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/customers_model.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/customers_model.js","s":{"1":1,"2":1,"3":1,"4":0,"5":1,"6":0,"7":0,"8":0,"9":0,"10":0,"11":1,"12":0,"13":0,"14":0,"15":0,"16":0,"17":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0},"fnMap":{"1":{"name":"(anonymous_1)","line":4,"loc":{"start":{"line":4,"column":15},"end":{"line":4,"column":28}}},"2":{"name":"(anonymous_2)","line":8,"loc":{"start":{"line":8,"column":15},"end":{"line":8,"column":34}}},"3":{"name":"(anonymous_3)","line":9,"loc":{"start":{"line":9,"column":20},"end":{"line":9,"column":47}}},"4":{"name":"(anonymous_4)","line":13,"loc":{"start":{"line":13,"column":35},"end":{"line":13,"column":54}}},"5":{"name":"(anonymous_5)","line":20,"loc":{"start":{"line":20,"column":16},"end":{"line":20,"column":49}}},"6":{"name":"(anonymous_6)","line":26,"loc":{"start":{"line":26,"column":5},"end":{"line":26,"column":32}}},"7":{"name":"(anonymous_7)","line":30,"loc":{"start":{"line":30,"column":36},"end":{"line":30,"column":56}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}},"3":{"start":{"line":4,"column":0},"end":{"line":6,"column":1}},"4":{"start":{"line":5,"column":2},"end":{"line":5,"column":15}},"5":{"start":{"line":8,"column":0},"end":{"line":18,"column":2}},"6":{"start":{"line":9,"column":2},"end":{"line":17,"column":4}},"7":{"start":{"line":10,"column":4},"end":{"line":16,"column":5}},"8":{"start":{"line":11,"column":6},"end":{"line":11,"column":78}},"9":{"start":{"line":13,"column":6},"end":{"line":15,"column":9}},"10":{"start":{"line":14,"column":8},"end":{"line":14,"column":41}},"11":{"start":{"line":20,"column":0},"end":{"line":35,"column":1}},"12":{"start":{"line":22,"column":1},"end":{"line":34,"column":4}},"13":{"start":{"line":27,"column":4},"end":{"line":33,"column":5}},"14":{"start":{"line":28,"column":6},"end":{"line":28,"column":77}},"15":{"start":{"line":30,"column":6},"end":{"line":32,"column":9}},"16":{"start":{"line":31,"column":8},"end":{"line":31,"column":23}},"17":{"start":{"line":37,"column":0},"end":{"line":37,"column":26}}},"branchMap":{"1":{"line":10,"type":"if","locations":[{"start":{"line":10,"column":4},"end":{"line":10,"column":4}},{"start":{"line":10,"column":4},"end":{"line":10,"column":4}}]},"2":{"line":10,"type":"binary-expr","locations":[{"start":{"line":10,"column":8},"end":{"line":10,"column":13}},{"start":{"line":10,"column":16},"end":{"line":10,"column":26}}]},"3":{"line":11,"type":"binary-expr","locations":[{"start":{"line":11,"column":15},"end":{"line":11,"column":20}},{"start":{"line":11,"column":24},"end":{"line":11,"column":65}}]},"4":{"line":27,"type":"if","locations":[{"start":{"line":27,"column":4},"end":{"line":27,"column":4}},{"start":{"line":27,"column":4},"end":{"line":27,"column":4}}]},"5":{"line":27,"type":"binary-expr","locations":[{"start":{"line":27,"column":8},"end":{"line":27,"column":13}},{"start":{"line":27,"column":17},"end":{"line":27,"column":27}}]},"6":{"line":28,"type":"binary-expr","locations":[{"start":{"line":28,"column":15},"end":{"line":28,"column":20}},{"start":{"line":28,"column":24},"end":{"line":28,"column":65}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/rentals_model.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/rentals_model.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":1,"11":0,"12":0,"13":0,"14":0,"15":1,"16":0,"17":0,"18":0,"19":0,"20":1,"21":0,"22":0,"23":0,"24":0,"25":1,"26":0,"27":0,"28":0,"29":0,"30":1,"31":0,"32":0,"33":0,"34":0,"35":1,"36":0,"37":0,"38":0,"39":0,"40":0,"41":1,"42":0,"43":0,"44":0,"45":0,"46":1,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0},"fnMap":{"1":{"name":"(anonymous_1)","line":4,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":109}}},"2":{"name":"(anonymous_2)","line":14,"loc":{"start":{"line":14,"column":23},"end":{"line":14,"column":49}}},"3":{"name":"(anonymous_3)","line":15,"loc":{"start":{"line":15,"column":63},"end":{"line":15,"column":92}}},"4":{"name":"(anonymous_4)","line":24,"loc":{"start":{"line":24,"column":27},"end":{"line":24,"column":59}}},"5":{"name":"(anonymous_5)","line":25,"loc":{"start":{"line":25,"column":75},"end":{"line":25,"column":104}}},"6":{"name":"(anonymous_6)","line":34,"loc":{"start":{"line":34,"column":32},"end":{"line":34,"column":58}}},"7":{"name":"(anonymous_7)","line":35,"loc":{"start":{"line":35,"column":58},"end":{"line":35,"column":82}}},"8":{"name":"(anonymous_8)","line":44,"loc":{"start":{"line":44,"column":24},"end":{"line":44,"column":56}}},"9":{"name":"(anonymous_9)","line":45,"loc":{"start":{"line":45,"column":168},"end":{"line":45,"column":198}}},"10":{"name":"(anonymous_10)","line":54,"loc":{"start":{"line":54,"column":22},"end":{"line":54,"column":54}}},"11":{"name":"(anonymous_11)","line":55,"loc":{"start":{"line":55,"column":167},"end":{"line":55,"column":194}}},"12":{"name":"(anonymous_12)","line":64,"loc":{"start":{"line":64,"column":20},"end":{"line":64,"column":39}}},"13":{"name":"(anonymous_13)","line":66,"loc":{"start":{"line":66,"column":266},"end":{"line":66,"column":293}}},"14":{"name":"(anonymous_14)","line":74,"loc":{"start":{"line":74,"column":19},"end":{"line":74,"column":49}}},"15":{"name":"(anonymous_15)","line":79,"loc":{"start":{"line":79,"column":7},"end":{"line":79,"column":36}}},"16":{"name":"(anonymous_16)","line":88,"loc":{"start":{"line":88,"column":21},"end":{"line":88,"column":57}}},"17":{"name":"(anonymous_17)","line":93,"loc":{"start":{"line":93,"column":5},"end":{"line":93,"column":29}}},"18":{"name":"(anonymous_18)","line":101,"loc":{"start":{"line":101,"column":90},"end":{"line":101,"column":149}}},"19":{"name":"(anonymous_19)","line":119,"loc":{"start":{"line":119,"column":9},"end":{"line":119,"column":34}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}},"3":{"start":{"line":4,"column":0},"end":{"line":12,"column":2}},"4":{"start":{"line":5,"column":2},"end":{"line":5,"column":27}},"5":{"start":{"line":6,"column":2},"end":{"line":6,"column":33}},"6":{"start":{"line":7,"column":2},"end":{"line":7,"column":35}},"7":{"start":{"line":8,"column":2},"end":{"line":8,"column":27}},"8":{"start":{"line":9,"column":2},"end":{"line":9,"column":27}},"9":{"start":{"line":10,"column":2},"end":{"line":10,"column":37}},"10":{"start":{"line":14,"column":0},"end":{"line":22,"column":1}},"11":{"start":{"line":15,"column":2},"end":{"line":21,"column":4}},"12":{"start":{"line":16,"column":4},"end":{"line":20,"column":5}},"13":{"start":{"line":17,"column":6},"end":{"line":17,"column":33}},"14":{"start":{"line":19,"column":6},"end":{"line":19,"column":34}},"15":{"start":{"line":24,"column":0},"end":{"line":32,"column":1}},"16":{"start":{"line":25,"column":2},"end":{"line":31,"column":4}},"17":{"start":{"line":26,"column":4},"end":{"line":30,"column":5}},"18":{"start":{"line":27,"column":6},"end":{"line":27,"column":33}},"19":{"start":{"line":29,"column":6},"end":{"line":29,"column":34}},"20":{"start":{"line":34,"column":0},"end":{"line":42,"column":1}},"21":{"start":{"line":35,"column":2},"end":{"line":41,"column":4}},"22":{"start":{"line":36,"column":4},"end":{"line":40,"column":5}},"23":{"start":{"line":37,"column":6},"end":{"line":37,"column":22}},"24":{"start":{"line":39,"column":6},"end":{"line":39,"column":28}},"25":{"start":{"line":44,"column":0},"end":{"line":52,"column":1}},"26":{"start":{"line":45,"column":2},"end":{"line":51,"column":4}},"27":{"start":{"line":46,"column":4},"end":{"line":50,"column":5}},"28":{"start":{"line":47,"column":6},"end":{"line":47,"column":33}},"29":{"start":{"line":49,"column":6},"end":{"line":49,"column":35}},"30":{"start":{"line":54,"column":0},"end":{"line":62,"column":1}},"31":{"start":{"line":55,"column":2},"end":{"line":61,"column":4}},"32":{"start":{"line":56,"column":4},"end":{"line":60,"column":5}},"33":{"start":{"line":57,"column":6},"end":{"line":57,"column":33}},"34":{"start":{"line":59,"column":6},"end":{"line":59,"column":32}},"35":{"start":{"line":64,"column":0},"end":{"line":72,"column":1}},"36":{"start":{"line":65,"column":2},"end":{"line":65,"column":22}},"37":{"start":{"line":66,"column":2},"end":{"line":71,"column":7}},"38":{"start":{"line":67,"column":4},"end":{"line":69,"column":5}},"39":{"start":{"line":68,"column":6},"end":{"line":68,"column":33}},"40":{"start":{"line":70,"column":4},"end":{"line":70,"column":29}},"41":{"start":{"line":74,"column":0},"end":{"line":86,"column":1}},"42":{"start":{"line":75,"column":2},"end":{"line":85,"column":4}},"43":{"start":{"line":80,"column":4},"end":{"line":84,"column":5}},"44":{"start":{"line":81,"column":6},"end":{"line":81,"column":33}},"45":{"start":{"line":83,"column":6},"end":{"line":83,"column":34}},"46":{"start":{"line":88,"column":0},"end":{"line":128,"column":1}},"47":{"start":{"line":90,"column":2},"end":{"line":127,"column":5}},"48":{"start":{"line":94,"column":4},"end":{"line":98,"column":5}},"49":{"start":{"line":95,"column":6},"end":{"line":95,"column":29}},"50":{"start":{"line":96,"column":11},"end":{"line":98,"column":5}},"51":{"start":{"line":97,"column":6},"end":{"line":97,"column":52}},"52":{"start":{"line":101,"column":6},"end":{"line":126,"column":7}},"53":{"start":{"line":102,"column":8},"end":{"line":104,"column":9}},"54":{"start":{"line":103,"column":10},"end":{"line":103,"column":33}},"55":{"start":{"line":107,"column":6},"end":{"line":107,"column":27}},"56":{"start":{"line":108,"column":6},"end":{"line":108,"column":30}},"57":{"start":{"line":109,"column":6},"end":{"line":109,"column":37}},"58":{"start":{"line":112,"column":6},"end":{"line":125,"column":9}},"59":{"start":{"line":120,"column":8},"end":{"line":122,"column":9}},"60":{"start":{"line":121,"column":10},"end":{"line":121,"column":33}},"61":{"start":{"line":124,"column":8},"end":{"line":124,"column":38}},"62":{"start":{"line":130,"column":0},"end":{"line":130,"column":24}}},"branchMap":{"1":{"line":16,"type":"if","locations":[{"start":{"line":16,"column":4},"end":{"line":16,"column":4}},{"start":{"line":16,"column":4},"end":{"line":16,"column":4}}]},"2":{"line":26,"type":"if","locations":[{"start":{"line":26,"column":4},"end":{"line":26,"column":4}},{"start":{"line":26,"column":4},"end":{"line":26,"column":4}}]},"3":{"line":36,"type":"if","locations":[{"start":{"line":36,"column":4},"end":{"line":36,"column":4}},{"start":{"line":36,"column":4},"end":{"line":36,"column":4}}]},"4":{"line":46,"type":"if","locations":[{"start":{"line":46,"column":4},"end":{"line":46,"column":4}},{"start":{"line":46,"column":4},"end":{"line":46,"column":4}}]},"5":{"line":56,"type":"if","locations":[{"start":{"line":56,"column":4},"end":{"line":56,"column":4}},{"start":{"line":56,"column":4},"end":{"line":56,"column":4}}]},"6":{"line":67,"type":"if","locations":[{"start":{"line":67,"column":4},"end":{"line":67,"column":4}},{"start":{"line":67,"column":4},"end":{"line":67,"column":4}}]},"7":{"line":80,"type":"if","locations":[{"start":{"line":80,"column":4},"end":{"line":80,"column":4}},{"start":{"line":80,"column":4},"end":{"line":80,"column":4}}]},"8":{"line":94,"type":"if","locations":[{"start":{"line":94,"column":4},"end":{"line":94,"column":4}},{"start":{"line":94,"column":4},"end":{"line":94,"column":4}}]},"9":{"line":96,"type":"if","locations":[{"start":{"line":96,"column":11},"end":{"line":96,"column":11}},{"start":{"line":96,"column":11},"end":{"line":96,"column":11}}]},"10":{"line":102,"type":"if","locations":[{"start":{"line":102,"column":8},"end":{"line":102,"column":8}},{"start":{"line":102,"column":8},"end":{"line":102,"column":8}}]},"11":{"line":120,"type":"if","locations":[{"start":{"line":120,"column":8},"end":{"line":120,"column":8}},{"start":{"line":120,"column":8},"end":{"line":120,"column":8}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/movies.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/movies.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1},"b":{},"f":{},"fnMap":{},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}},"3":{"start":{"line":3,"column":0},"end":{"line":3,"column":49}},"4":{"start":{"line":6,"column":0},"end":{"line":6,"column":37}},"5":{"start":{"line":7,"column":0},"end":{"line":7,"column":52}},"6":{"start":{"line":8,"column":0},"end":{"line":8,"column":61}},"7":{"start":{"line":9,"column":0},"end":{"line":9,"column":58}},"8":{"start":{"line":12,"column":0},"end":{"line":12,"column":24}}},"branchMap":{}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/movies.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/movies.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0},"fnMap":{"1":{"name":"(anonymous_1)","line":6,"loc":{"start":{"line":6,"column":12},"end":{"line":6,"column":31}}},"2":{"name":"(anonymous_2)","line":7,"loc":{"start":{"line":7,"column":12},"end":{"line":7,"column":36}}},"3":{"name":"(anonymous_3)","line":17,"loc":{"start":{"line":17,"column":15},"end":{"line":17,"column":34}}},"4":{"name":"(anonymous_4)","line":18,"loc":{"start":{"line":18,"column":58},"end":{"line":18,"column":80}}},"5":{"name":"(anonymous_5)","line":29,"loc":{"start":{"line":29,"column":22},"end":{"line":29,"column":41}}},"6":{"name":"(anonymous_6)","line":30,"loc":{"start":{"line":30,"column":41},"end":{"line":30,"column":70}}},"7":{"name":"(anonymous_7)","line":40,"loc":{"start":{"line":40,"column":19},"end":{"line":40,"column":38}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":48}},"3":{"start":{"line":5,"column":0},"end":{"line":43,"column":1}},"4":{"start":{"line":7,"column":2},"end":{"line":14,"column":4}},"5":{"start":{"line":8,"column":3},"end":{"line":13,"column":4}},"6":{"start":{"line":9,"column":4},"end":{"line":9,"column":74}},"7":{"start":{"line":10,"column":4},"end":{"line":10,"column":21}},"8":{"start":{"line":12,"column":4},"end":{"line":12,"column":20}},"9":{"start":{"line":18,"column":2},"end":{"line":26,"column":4}},"10":{"start":{"line":19,"column":3},"end":{"line":24,"column":4}},"11":{"start":{"line":20,"column":4},"end":{"line":20,"column":40}},"12":{"start":{"line":21,"column":4},"end":{"line":21,"column":21}},"13":{"start":{"line":23,"column":4},"end":{"line":23,"column":18}},"14":{"start":{"line":30,"column":3},"end":{"line":37,"column":4}},"15":{"start":{"line":31,"column":3},"end":{"line":36,"column":4}},"16":{"start":{"line":32,"column":4},"end":{"line":32,"column":61}},"17":{"start":{"line":33,"column":4},"end":{"line":33,"column":21}},"18":{"start":{"line":35,"column":5},"end":{"line":35,"column":26}},"19":{"start":{"line":45,"column":0},"end":{"line":45,"column":33}}},"branchMap":{"1":{"line":8,"type":"if","locations":[{"start":{"line":8,"column":3},"end":{"line":8,"column":3}},{"start":{"line":8,"column":3},"end":{"line":8,"column":3}}]},"2":{"line":19,"type":"if","locations":[{"start":{"line":19,"column":3},"end":{"line":19,"column":3}},{"start":{"line":19,"column":3},"end":{"line":19,"column":3}}]},"3":{"line":31,"type":"if","locations":[{"start":{"line":31,"column":3},"end":{"line":31,"column":3}},{"start":{"line":31,"column":3},"end":{"line":31,"column":3}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/movies_model.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/movies_model.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":1,"7":0,"8":0,"9":0,"10":0,"11":0,"12":1,"13":0,"14":0,"15":0,"16":0,"17":1,"18":0,"19":0,"20":0,"21":0,"22":0,"23":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0},"fnMap":{"1":{"name":"(anonymous_1)","line":4,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":39}}},"2":{"name":"(anonymous_2)","line":9,"loc":{"start":{"line":9,"column":12},"end":{"line":9,"column":31}}},"3":{"name":"(anonymous_3)","line":10,"loc":{"start":{"line":10,"column":17},"end":{"line":10,"column":41}}},"4":{"name":"(anonymous_4)","line":14,"loc":{"start":{"line":14,"column":32},"end":{"line":14,"column":48}}},"5":{"name":"(anonymous_5)","line":21,"loc":{"start":{"line":21,"column":18},"end":{"line":21,"column":44}}},"6":{"name":"(anonymous_6)","line":22,"loc":{"start":{"line":22,"column":36},"end":{"line":22,"column":59}}},"7":{"name":"(anonymous_7)","line":33,"loc":{"start":{"line":33,"column":13},"end":{"line":33,"column":46}}},"8":{"name":"(anonymous_8)","line":39,"loc":{"start":{"line":39,"column":5},"end":{"line":39,"column":29}}},"9":{"name":"(anonymous_9)","line":43,"loc":{"start":{"line":43,"column":33},"end":{"line":43,"column":50}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}},"3":{"start":{"line":4,"column":0},"end":{"line":7,"column":1}},"4":{"start":{"line":5,"column":2},"end":{"line":5,"column":21}},"5":{"start":{"line":6,"column":2},"end":{"line":6,"column":29}},"6":{"start":{"line":9,"column":0},"end":{"line":19,"column":2}},"7":{"start":{"line":10,"column":2},"end":{"line":18,"column":4}},"8":{"start":{"line":11,"column":4},"end":{"line":17,"column":5}},"9":{"start":{"line":12,"column":6},"end":{"line":12,"column":75}},"10":{"start":{"line":14,"column":6},"end":{"line":16,"column":9}},"11":{"start":{"line":15,"column":8},"end":{"line":15,"column":38}},"12":{"start":{"line":21,"column":0},"end":{"line":31,"column":2}},"13":{"start":{"line":22,"column":2},"end":{"line":30,"column":4}},"14":{"start":{"line":24,"column":4},"end":{"line":29,"column":5}},"15":{"start":{"line":26,"column":6},"end":{"line":26,"column":65}},"16":{"start":{"line":28,"column":6},"end":{"line":28,"column":27}},"17":{"start":{"line":33,"column":0},"end":{"line":48,"column":1}},"18":{"start":{"line":35,"column":1},"end":{"line":47,"column":4}},"19":{"start":{"line":40,"column":4},"end":{"line":46,"column":5}},"20":{"start":{"line":41,"column":6},"end":{"line":41,"column":74}},"21":{"start":{"line":43,"column":6},"end":{"line":45,"column":9}},"22":{"start":{"line":44,"column":8},"end":{"line":44,"column":20}},"23":{"start":{"line":50,"column":0},"end":{"line":50,"column":23}}},"branchMap":{"1":{"line":11,"type":"if","locations":[{"start":{"line":11,"column":4},"end":{"line":11,"column":4}},{"start":{"line":11,"column":4},"end":{"line":11,"column":4}}]},"2":{"line":11,"type":"binary-expr","locations":[{"start":{"line":11,"column":8},"end":{"line":11,"column":13}},{"start":{"line":11,"column":16},"end":{"line":11,"column":23}}]},"3":{"line":12,"type":"binary-expr","locations":[{"start":{"line":12,"column":15},"end":{"line":12,"column":20}},{"start":{"line":12,"column":24},"end":{"line":12,"column":62}}]},"4":{"line":24,"type":"if","locations":[{"start":{"line":24,"column":4},"end":{"line":24,"column":4}},{"start":{"line":24,"column":4},"end":{"line":24,"column":4}}]},"5":{"line":24,"type":"binary-expr","locations":[{"start":{"line":24,"column":8},"end":{"line":24,"column":13}},{"start":{"line":24,"column":17},"end":{"line":24,"column":23}}]},"6":{"line":26,"type":"binary-expr","locations":[{"start":{"line":26,"column":15},"end":{"line":26,"column":20}},{"start":{"line":26,"column":24},"end":{"line":26,"column":52}}]},"7":{"line":40,"type":"if","locations":[{"start":{"line":40,"column":4},"end":{"line":40,"column":4}},{"start":{"line":40,"column":4},"end":{"line":40,"column":4}}]},"8":{"line":40,"type":"binary-expr","locations":[{"start":{"line":40,"column":8},"end":{"line":40,"column":13}},{"start":{"line":40,"column":17},"end":{"line":40,"column":24}}]},"9":{"line":41,"type":"binary-expr","locations":[{"start":{"line":41,"column":15},"end":{"line":41,"column":20}},{"start":{"line":41,"column":24},"end":{"line":41,"column":62}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/rentals.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/rentals.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1},"b":{},"f":{},"fnMap":{},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}},"3":{"start":{"line":3,"column":0},"end":{"line":3,"column":50}},"4":{"start":{"line":5,"column":0},"end":{"line":5,"column":52}},"5":{"start":{"line":6,"column":0},"end":{"line":6,"column":44}},"6":{"start":{"line":7,"column":0},"end":{"line":7,"column":63}},"7":{"start":{"line":9,"column":0},"end":{"line":9,"column":74}},"8":{"start":{"line":12,"column":0},"end":{"line":12,"column":54}},"9":{"start":{"line":17,"column":0},"end":{"line":17,"column":24}}},"branchMap":{}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/rentals.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/rentals.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0},"fnMap":{"1":{"name":"(anonymous_1)","line":5,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":32}}},"2":{"name":"(anonymous_2)","line":6,"loc":{"start":{"line":6,"column":36},"end":{"line":6,"column":59}}},"3":{"name":"(anonymous_3)","line":11,"loc":{"start":{"line":11,"column":41},"end":{"line":11,"column":70}}},"4":{"name":"(anonymous_4)","line":26,"loc":{"start":{"line":26,"column":22},"end":{"line":26,"column":41}}},"5":{"name":"(anonymous_5)","line":27,"loc":{"start":{"line":27,"column":41},"end":{"line":27,"column":70}}},"6":{"name":"(anonymous_6)","line":37,"loc":{"start":{"line":37,"column":21},"end":{"line":37,"column":46}}},"7":{"name":"(anonymous_7)","line":38,"loc":{"start":{"line":38,"column":62},"end":{"line":38,"column":91}}},"8":{"name":"(anonymous_8)","line":48,"loc":{"start":{"line":48,"column":19},"end":{"line":48,"column":38}}},"9":{"name":"(anonymous_9)","line":49,"loc":{"start":{"line":49,"column":34},"end":{"line":49,"column":60}}},"10":{"name":"(anonymous_10)","line":60,"loc":{"start":{"line":60,"column":20},"end":{"line":60,"column":39}}},"11":{"name":"(anonymous_11)","line":61,"loc":{"start":{"line":61,"column":20},"end":{"line":61,"column":46}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":46}},"3":{"start":{"line":4,"column":0},"end":{"line":70,"column":1}},"4":{"start":{"line":6,"column":2},"end":{"line":23,"column":4}},"5":{"start":{"line":7,"column":3},"end":{"line":21,"column":4}},"6":{"start":{"line":8,"column":4},"end":{"line":8,"column":41}},"7":{"start":{"line":9,"column":4},"end":{"line":9,"column":21}},"8":{"start":{"line":11,"column":4},"end":{"line":20,"column":6}},"9":{"start":{"line":12,"column":5},"end":{"line":18,"column":6}},"10":{"start":{"line":19,"column":5},"end":{"line":19,"column":26}},"11":{"start":{"line":27,"column":3},"end":{"line":34,"column":4}},"12":{"start":{"line":28,"column":3},"end":{"line":33,"column":4}},"13":{"start":{"line":29,"column":4},"end":{"line":29,"column":61}},"14":{"start":{"line":30,"column":4},"end":{"line":30,"column":21}},"15":{"start":{"line":32,"column":5},"end":{"line":32,"column":26}},"16":{"start":{"line":38,"column":2},"end":{"line":45,"column":5}},"17":{"start":{"line":39,"column":3},"end":{"line":44,"column":4}},"18":{"start":{"line":40,"column":4},"end":{"line":40,"column":61}},"19":{"start":{"line":41,"column":4},"end":{"line":41,"column":21}},"20":{"start":{"line":43,"column":4},"end":{"line":43,"column":25}},"21":{"start":{"line":49,"column":2},"end":{"line":56,"column":5}},"22":{"start":{"line":50,"column":3},"end":{"line":55,"column":4}},"23":{"start":{"line":51,"column":4},"end":{"line":51,"column":61}},"24":{"start":{"line":52,"column":4},"end":{"line":52,"column":21}},"25":{"start":{"line":54,"column":4},"end":{"line":54,"column":22}},"26":{"start":{"line":61,"column":2},"end":{"line":68,"column":5}},"27":{"start":{"line":62,"column":3},"end":{"line":67,"column":4}},"28":{"start":{"line":63,"column":4},"end":{"line":63,"column":33}},"29":{"start":{"line":64,"column":4},"end":{"line":64,"column":21}},"30":{"start":{"line":66,"column":4},"end":{"line":66,"column":22}},"31":{"start":{"line":72,"column":0},"end":{"line":72,"column":34}}},"branchMap":{"1":{"line":7,"type":"if","locations":[{"start":{"line":7,"column":3},"end":{"line":7,"column":3}},{"start":{"line":7,"column":3},"end":{"line":7,"column":3}}]},"2":{"line":28,"type":"if","locations":[{"start":{"line":28,"column":3},"end":{"line":28,"column":3}},{"start":{"line":28,"column":3},"end":{"line":28,"column":3}}]},"3":{"line":39,"type":"if","locations":[{"start":{"line":39,"column":3},"end":{"line":39,"column":3}},{"start":{"line":39,"column":3},"end":{"line":39,"column":3}}]},"4":{"line":50,"type":"if","locations":[{"start":{"line":50,"column":3},"end":{"line":50,"column":3}},{"start":{"line":50,"column":3},"end":{"line":50,"column":3}}]},"5":{"line":62,"type":"if","locations":[{"start":{"line":62,"column":3},"end":{"line":62,"column":3}},{"start":{"line":62,"column":3},"end":{"line":62,"column":3}}]}}}} \ No newline at end of file +{"/Users/leahpetersen/C5/projects/VideoStoreAPI/app.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/app.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":1,"19":1,"20":1,"21":1,"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":0,"29":0,"30":0,"31":1,"32":0,"33":0,"34":0,"35":1,"36":0,"37":0,"38":1},"b":{"1":[0,1],"2":[0,0],"3":[0,0]},"f":{"1":0,"2":0,"3":0},"fnMap":{"1":{"name":"(anonymous_1)","line":50,"loc":{"start":{"line":50,"column":8},"end":{"line":50,"column":33}}},"2":{"name":"(anonymous_2)","line":61,"loc":{"start":{"line":61,"column":10},"end":{"line":61,"column":40}}},"3":{"name":"(anonymous_3)","line":72,"loc":{"start":{"line":72,"column":8},"end":{"line":72,"column":38}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":27}},"3":{"start":{"line":3,"column":0},"end":{"line":3,"column":39}},"4":{"start":{"line":4,"column":0},"end":{"line":4,"column":31}},"5":{"start":{"line":5,"column":0},"end":{"line":5,"column":44}},"6":{"start":{"line":6,"column":0},"end":{"line":6,"column":40}},"7":{"start":{"line":7,"column":0},"end":{"line":7,"column":33}},"8":{"start":{"line":8,"column":0},"end":{"line":8,"column":37}},"9":{"start":{"line":11,"column":0},"end":{"line":11,"column":76}},"10":{"start":{"line":16,"column":0},"end":{"line":16,"column":80}},"11":{"start":{"line":19,"column":0},"end":{"line":19,"column":31}},"12":{"start":{"line":23,"column":0},"end":{"line":23,"column":48}},"13":{"start":{"line":24,"column":0},"end":{"line":24,"column":31}},"14":{"start":{"line":28,"column":0},"end":{"line":28,"column":23}},"15":{"start":{"line":31,"column":0},"end":{"line":31,"column":27}},"16":{"start":{"line":32,"column":0},"end":{"line":32,"column":52}},"17":{"start":{"line":33,"column":0},"end":{"line":33,"column":24}},"18":{"start":{"line":34,"column":0},"end":{"line":34,"column":56}},"19":{"start":{"line":36,"column":0},"end":{"line":36,"column":42}},"20":{"start":{"line":37,"column":0},"end":{"line":37,"column":46}},"21":{"start":{"line":38,"column":0},"end":{"line":38,"column":43}},"22":{"start":{"line":39,"column":0},"end":{"line":39,"column":44}},"23":{"start":{"line":43,"column":0},"end":{"line":43,"column":21}},"24":{"start":{"line":44,"column":0},"end":{"line":44,"column":33}},"25":{"start":{"line":45,"column":0},"end":{"line":45,"column":27}},"26":{"start":{"line":46,"column":0},"end":{"line":46,"column":29}},"27":{"start":{"line":50,"column":0},"end":{"line":54,"column":3}},"28":{"start":{"line":51,"column":2},"end":{"line":51,"column":35}},"29":{"start":{"line":52,"column":2},"end":{"line":52,"column":19}},"30":{"start":{"line":53,"column":2},"end":{"line":53,"column":12}},"31":{"start":{"line":60,"column":0},"end":{"line":68,"column":1}},"32":{"start":{"line":61,"column":2},"end":{"line":67,"column":5}},"33":{"start":{"line":62,"column":4},"end":{"line":62,"column":34}},"34":{"start":{"line":63,"column":4},"end":{"line":66,"column":7}},"35":{"start":{"line":72,"column":0},"end":{"line":78,"column":3}},"36":{"start":{"line":73,"column":2},"end":{"line":73,"column":32}},"37":{"start":{"line":74,"column":2},"end":{"line":77,"column":5}},"38":{"start":{"line":81,"column":0},"end":{"line":81,"column":21}}},"branchMap":{"1":{"line":60,"type":"if","locations":[{"start":{"line":60,"column":0},"end":{"line":60,"column":0}},{"start":{"line":60,"column":0},"end":{"line":60,"column":0}}]},"2":{"line":62,"type":"binary-expr","locations":[{"start":{"line":62,"column":15},"end":{"line":62,"column":25}},{"start":{"line":62,"column":29},"end":{"line":62,"column":32}}]},"3":{"line":73,"type":"binary-expr","locations":[{"start":{"line":73,"column":13},"end":{"line":73,"column":23}},{"start":{"line":73,"column":27},"end":{"line":73,"column":30}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/index.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/index.js","s":{"1":1,"2":1,"3":1,"4":0,"5":1,"6":0,"7":1},"b":{},"f":{"1":0,"2":0},"fnMap":{"1":{"name":"(anonymous_1)","line":6,"loc":{"start":{"line":6,"column":16},"end":{"line":6,"column":41}}},"2":{"name":"(anonymous_2)","line":10,"loc":{"start":{"line":10,"column":20},"end":{"line":10,"column":45}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}},"3":{"start":{"line":6,"column":0},"end":{"line":8,"column":3}},"4":{"start":{"line":7,"column":2},"end":{"line":7,"column":40}},"5":{"start":{"line":10,"column":0},"end":{"line":12,"column":3}},"6":{"start":{"line":11,"column":2},"end":{"line":11,"column":49}},"7":{"start":{"line":14,"column":0},"end":{"line":14,"column":24}}},"branchMap":{}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/customers.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/customers.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1},"b":{},"f":{},"fnMap":{},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}},"3":{"start":{"line":3,"column":0},"end":{"line":3,"column":52}},"4":{"start":{"line":6,"column":0},"end":{"line":6,"column":40}},"5":{"start":{"line":7,"column":0},"end":{"line":7,"column":55}},"6":{"start":{"line":8,"column":0},"end":{"line":8,"column":67}},"7":{"start":{"line":9,"column":0},"end":{"line":9,"column":67}},"8":{"start":{"line":12,"column":0},"end":{"line":12,"column":24}}},"branchMap":{}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/customers.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/customers.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0},"fnMap":{"1":{"name":"(anonymous_1)","line":6,"loc":{"start":{"line":6,"column":15},"end":{"line":6,"column":34}}},"2":{"name":"(anonymous_2)","line":7,"loc":{"start":{"line":7,"column":15},"end":{"line":7,"column":42}}},"3":{"name":"(anonymous_3)","line":17,"loc":{"start":{"line":17,"column":18},"end":{"line":17,"column":37}}},"4":{"name":"(anonymous_4)","line":18,"loc":{"start":{"line":18,"column":61},"end":{"line":18,"column":83}}},"5":{"name":"(anonymous_5)","line":29,"loc":{"start":{"line":29,"column":22},"end":{"line":29,"column":41}}},"6":{"name":"(anonymous_6)","line":30,"loc":{"start":{"line":30,"column":51},"end":{"line":30,"column":73}}},"7":{"name":"(anonymous_7)","line":40,"loc":{"start":{"line":40,"column":22},"end":{"line":40,"column":41}}},"8":{"name":"(anonymous_8)","line":41,"loc":{"start":{"line":41,"column":48},"end":{"line":41,"column":70}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":48}},"3":{"start":{"line":5,"column":0},"end":{"line":50,"column":1}},"4":{"start":{"line":7,"column":2},"end":{"line":14,"column":4}},"5":{"start":{"line":8,"column":3},"end":{"line":13,"column":4}},"6":{"start":{"line":9,"column":4},"end":{"line":9,"column":76}},"7":{"start":{"line":10,"column":4},"end":{"line":10,"column":21}},"8":{"start":{"line":12,"column":4},"end":{"line":12,"column":23}},"9":{"start":{"line":18,"column":2},"end":{"line":25,"column":4}},"10":{"start":{"line":19,"column":3},"end":{"line":24,"column":4}},"11":{"start":{"line":20,"column":4},"end":{"line":20,"column":40}},"12":{"start":{"line":21,"column":4},"end":{"line":21,"column":21}},"13":{"start":{"line":23,"column":4},"end":{"line":23,"column":18}},"14":{"start":{"line":30,"column":2},"end":{"line":37,"column":4}},"15":{"start":{"line":31,"column":3},"end":{"line":36,"column":4}},"16":{"start":{"line":32,"column":4},"end":{"line":32,"column":40}},"17":{"start":{"line":33,"column":4},"end":{"line":33,"column":21}},"18":{"start":{"line":35,"column":4},"end":{"line":35,"column":18}},"19":{"start":{"line":41,"column":2},"end":{"line":48,"column":4}},"20":{"start":{"line":42,"column":3},"end":{"line":47,"column":4}},"21":{"start":{"line":43,"column":4},"end":{"line":43,"column":40}},"22":{"start":{"line":44,"column":4},"end":{"line":44,"column":21}},"23":{"start":{"line":46,"column":4},"end":{"line":46,"column":18}},"24":{"start":{"line":51,"column":0},"end":{"line":51,"column":36}}},"branchMap":{"1":{"line":8,"type":"if","locations":[{"start":{"line":8,"column":3},"end":{"line":8,"column":3}},{"start":{"line":8,"column":3},"end":{"line":8,"column":3}}]},"2":{"line":19,"type":"if","locations":[{"start":{"line":19,"column":3},"end":{"line":19,"column":3}},{"start":{"line":19,"column":3},"end":{"line":19,"column":3}}]},"3":{"line":31,"type":"if","locations":[{"start":{"line":31,"column":3},"end":{"line":31,"column":3}},{"start":{"line":31,"column":3},"end":{"line":31,"column":3}}]},"4":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":3},"end":{"line":42,"column":3}},{"start":{"line":42,"column":3},"end":{"line":42,"column":3}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/customers_model.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/customers_model.js","s":{"1":1,"2":1,"3":1,"4":400,"5":1,"6":2,"7":2,"8":0,"9":2,"10":400,"11":1,"12":0,"13":0,"14":0,"15":0,"16":0,"17":1},"b":{"1":[0,2],"2":[2,2],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0]},"f":{"1":400,"2":2,"3":2,"4":400,"5":0,"6":0,"7":0},"fnMap":{"1":{"name":"(anonymous_1)","line":4,"loc":{"start":{"line":4,"column":15},"end":{"line":4,"column":28}}},"2":{"name":"(anonymous_2)","line":8,"loc":{"start":{"line":8,"column":15},"end":{"line":8,"column":34}}},"3":{"name":"(anonymous_3)","line":9,"loc":{"start":{"line":9,"column":20},"end":{"line":9,"column":47}}},"4":{"name":"(anonymous_4)","line":13,"loc":{"start":{"line":13,"column":35},"end":{"line":13,"column":54}}},"5":{"name":"(anonymous_5)","line":20,"loc":{"start":{"line":20,"column":16},"end":{"line":20,"column":49}}},"6":{"name":"(anonymous_6)","line":26,"loc":{"start":{"line":26,"column":5},"end":{"line":26,"column":32}}},"7":{"name":"(anonymous_7)","line":30,"loc":{"start":{"line":30,"column":36},"end":{"line":30,"column":56}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}},"3":{"start":{"line":4,"column":0},"end":{"line":6,"column":1}},"4":{"start":{"line":5,"column":2},"end":{"line":5,"column":15}},"5":{"start":{"line":8,"column":0},"end":{"line":18,"column":2}},"6":{"start":{"line":9,"column":2},"end":{"line":17,"column":4}},"7":{"start":{"line":10,"column":4},"end":{"line":16,"column":5}},"8":{"start":{"line":11,"column":6},"end":{"line":11,"column":78}},"9":{"start":{"line":13,"column":6},"end":{"line":15,"column":9}},"10":{"start":{"line":14,"column":8},"end":{"line":14,"column":41}},"11":{"start":{"line":20,"column":0},"end":{"line":35,"column":1}},"12":{"start":{"line":22,"column":1},"end":{"line":34,"column":4}},"13":{"start":{"line":27,"column":4},"end":{"line":33,"column":5}},"14":{"start":{"line":28,"column":6},"end":{"line":28,"column":77}},"15":{"start":{"line":30,"column":6},"end":{"line":32,"column":9}},"16":{"start":{"line":31,"column":8},"end":{"line":31,"column":23}},"17":{"start":{"line":37,"column":0},"end":{"line":37,"column":26}}},"branchMap":{"1":{"line":10,"type":"if","locations":[{"start":{"line":10,"column":4},"end":{"line":10,"column":4}},{"start":{"line":10,"column":4},"end":{"line":10,"column":4}}]},"2":{"line":10,"type":"binary-expr","locations":[{"start":{"line":10,"column":8},"end":{"line":10,"column":13}},{"start":{"line":10,"column":16},"end":{"line":10,"column":26}}]},"3":{"line":11,"type":"binary-expr","locations":[{"start":{"line":11,"column":15},"end":{"line":11,"column":20}},{"start":{"line":11,"column":24},"end":{"line":11,"column":65}}]},"4":{"line":27,"type":"if","locations":[{"start":{"line":27,"column":4},"end":{"line":27,"column":4}},{"start":{"line":27,"column":4},"end":{"line":27,"column":4}}]},"5":{"line":27,"type":"binary-expr","locations":[{"start":{"line":27,"column":8},"end":{"line":27,"column":13}},{"start":{"line":27,"column":17},"end":{"line":27,"column":27}}]},"6":{"line":28,"type":"binary-expr","locations":[{"start":{"line":28,"column":15},"end":{"line":28,"column":20}},{"start":{"line":28,"column":24},"end":{"line":28,"column":65}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/rentals_model.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/rentals_model.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":1,"11":0,"12":0,"13":0,"14":0,"15":1,"16":0,"17":0,"18":0,"19":0,"20":1,"21":0,"22":0,"23":0,"24":0,"25":1,"26":0,"27":0,"28":0,"29":0,"30":1,"31":0,"32":0,"33":0,"34":0,"35":1,"36":0,"37":0,"38":0,"39":0,"40":0,"41":1,"42":0,"43":0,"44":0,"45":0,"46":1,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0},"fnMap":{"1":{"name":"(anonymous_1)","line":4,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":109}}},"2":{"name":"(anonymous_2)","line":14,"loc":{"start":{"line":14,"column":23},"end":{"line":14,"column":49}}},"3":{"name":"(anonymous_3)","line":15,"loc":{"start":{"line":15,"column":63},"end":{"line":15,"column":92}}},"4":{"name":"(anonymous_4)","line":24,"loc":{"start":{"line":24,"column":27},"end":{"line":24,"column":59}}},"5":{"name":"(anonymous_5)","line":25,"loc":{"start":{"line":25,"column":75},"end":{"line":25,"column":104}}},"6":{"name":"(anonymous_6)","line":34,"loc":{"start":{"line":34,"column":32},"end":{"line":34,"column":58}}},"7":{"name":"(anonymous_7)","line":35,"loc":{"start":{"line":35,"column":58},"end":{"line":35,"column":82}}},"8":{"name":"(anonymous_8)","line":44,"loc":{"start":{"line":44,"column":24},"end":{"line":44,"column":56}}},"9":{"name":"(anonymous_9)","line":45,"loc":{"start":{"line":45,"column":168},"end":{"line":45,"column":198}}},"10":{"name":"(anonymous_10)","line":54,"loc":{"start":{"line":54,"column":22},"end":{"line":54,"column":54}}},"11":{"name":"(anonymous_11)","line":55,"loc":{"start":{"line":55,"column":167},"end":{"line":55,"column":194}}},"12":{"name":"(anonymous_12)","line":64,"loc":{"start":{"line":64,"column":20},"end":{"line":64,"column":39}}},"13":{"name":"(anonymous_13)","line":66,"loc":{"start":{"line":66,"column":266},"end":{"line":66,"column":293}}},"14":{"name":"(anonymous_14)","line":74,"loc":{"start":{"line":74,"column":19},"end":{"line":74,"column":49}}},"15":{"name":"(anonymous_15)","line":79,"loc":{"start":{"line":79,"column":7},"end":{"line":79,"column":36}}},"16":{"name":"(anonymous_16)","line":88,"loc":{"start":{"line":88,"column":21},"end":{"line":88,"column":57}}},"17":{"name":"(anonymous_17)","line":93,"loc":{"start":{"line":93,"column":5},"end":{"line":93,"column":29}}},"18":{"name":"(anonymous_18)","line":101,"loc":{"start":{"line":101,"column":90},"end":{"line":101,"column":149}}},"19":{"name":"(anonymous_19)","line":119,"loc":{"start":{"line":119,"column":9},"end":{"line":119,"column":34}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}},"3":{"start":{"line":4,"column":0},"end":{"line":12,"column":2}},"4":{"start":{"line":5,"column":2},"end":{"line":5,"column":27}},"5":{"start":{"line":6,"column":2},"end":{"line":6,"column":33}},"6":{"start":{"line":7,"column":2},"end":{"line":7,"column":35}},"7":{"start":{"line":8,"column":2},"end":{"line":8,"column":27}},"8":{"start":{"line":9,"column":2},"end":{"line":9,"column":27}},"9":{"start":{"line":10,"column":2},"end":{"line":10,"column":37}},"10":{"start":{"line":14,"column":0},"end":{"line":22,"column":1}},"11":{"start":{"line":15,"column":2},"end":{"line":21,"column":4}},"12":{"start":{"line":16,"column":4},"end":{"line":20,"column":5}},"13":{"start":{"line":17,"column":6},"end":{"line":17,"column":33}},"14":{"start":{"line":19,"column":6},"end":{"line":19,"column":34}},"15":{"start":{"line":24,"column":0},"end":{"line":32,"column":1}},"16":{"start":{"line":25,"column":2},"end":{"line":31,"column":4}},"17":{"start":{"line":26,"column":4},"end":{"line":30,"column":5}},"18":{"start":{"line":27,"column":6},"end":{"line":27,"column":33}},"19":{"start":{"line":29,"column":6},"end":{"line":29,"column":34}},"20":{"start":{"line":34,"column":0},"end":{"line":42,"column":1}},"21":{"start":{"line":35,"column":2},"end":{"line":41,"column":4}},"22":{"start":{"line":36,"column":4},"end":{"line":40,"column":5}},"23":{"start":{"line":37,"column":6},"end":{"line":37,"column":22}},"24":{"start":{"line":39,"column":6},"end":{"line":39,"column":28}},"25":{"start":{"line":44,"column":0},"end":{"line":52,"column":1}},"26":{"start":{"line":45,"column":2},"end":{"line":51,"column":4}},"27":{"start":{"line":46,"column":4},"end":{"line":50,"column":5}},"28":{"start":{"line":47,"column":6},"end":{"line":47,"column":33}},"29":{"start":{"line":49,"column":6},"end":{"line":49,"column":35}},"30":{"start":{"line":54,"column":0},"end":{"line":62,"column":1}},"31":{"start":{"line":55,"column":2},"end":{"line":61,"column":4}},"32":{"start":{"line":56,"column":4},"end":{"line":60,"column":5}},"33":{"start":{"line":57,"column":6},"end":{"line":57,"column":33}},"34":{"start":{"line":59,"column":6},"end":{"line":59,"column":32}},"35":{"start":{"line":64,"column":0},"end":{"line":72,"column":1}},"36":{"start":{"line":65,"column":2},"end":{"line":65,"column":22}},"37":{"start":{"line":66,"column":2},"end":{"line":71,"column":7}},"38":{"start":{"line":67,"column":4},"end":{"line":69,"column":5}},"39":{"start":{"line":68,"column":6},"end":{"line":68,"column":33}},"40":{"start":{"line":70,"column":4},"end":{"line":70,"column":29}},"41":{"start":{"line":74,"column":0},"end":{"line":86,"column":1}},"42":{"start":{"line":75,"column":2},"end":{"line":85,"column":4}},"43":{"start":{"line":80,"column":4},"end":{"line":84,"column":5}},"44":{"start":{"line":81,"column":6},"end":{"line":81,"column":33}},"45":{"start":{"line":83,"column":6},"end":{"line":83,"column":34}},"46":{"start":{"line":88,"column":0},"end":{"line":128,"column":1}},"47":{"start":{"line":90,"column":2},"end":{"line":127,"column":5}},"48":{"start":{"line":94,"column":4},"end":{"line":98,"column":5}},"49":{"start":{"line":95,"column":6},"end":{"line":95,"column":29}},"50":{"start":{"line":96,"column":11},"end":{"line":98,"column":5}},"51":{"start":{"line":97,"column":6},"end":{"line":97,"column":52}},"52":{"start":{"line":101,"column":6},"end":{"line":126,"column":7}},"53":{"start":{"line":102,"column":8},"end":{"line":104,"column":9}},"54":{"start":{"line":103,"column":10},"end":{"line":103,"column":33}},"55":{"start":{"line":107,"column":6},"end":{"line":107,"column":27}},"56":{"start":{"line":108,"column":6},"end":{"line":108,"column":30}},"57":{"start":{"line":109,"column":6},"end":{"line":109,"column":37}},"58":{"start":{"line":112,"column":6},"end":{"line":125,"column":9}},"59":{"start":{"line":120,"column":8},"end":{"line":122,"column":9}},"60":{"start":{"line":121,"column":10},"end":{"line":121,"column":33}},"61":{"start":{"line":124,"column":8},"end":{"line":124,"column":38}},"62":{"start":{"line":130,"column":0},"end":{"line":130,"column":24}}},"branchMap":{"1":{"line":16,"type":"if","locations":[{"start":{"line":16,"column":4},"end":{"line":16,"column":4}},{"start":{"line":16,"column":4},"end":{"line":16,"column":4}}]},"2":{"line":26,"type":"if","locations":[{"start":{"line":26,"column":4},"end":{"line":26,"column":4}},{"start":{"line":26,"column":4},"end":{"line":26,"column":4}}]},"3":{"line":36,"type":"if","locations":[{"start":{"line":36,"column":4},"end":{"line":36,"column":4}},{"start":{"line":36,"column":4},"end":{"line":36,"column":4}}]},"4":{"line":46,"type":"if","locations":[{"start":{"line":46,"column":4},"end":{"line":46,"column":4}},{"start":{"line":46,"column":4},"end":{"line":46,"column":4}}]},"5":{"line":56,"type":"if","locations":[{"start":{"line":56,"column":4},"end":{"line":56,"column":4}},{"start":{"line":56,"column":4},"end":{"line":56,"column":4}}]},"6":{"line":67,"type":"if","locations":[{"start":{"line":67,"column":4},"end":{"line":67,"column":4}},{"start":{"line":67,"column":4},"end":{"line":67,"column":4}}]},"7":{"line":80,"type":"if","locations":[{"start":{"line":80,"column":4},"end":{"line":80,"column":4}},{"start":{"line":80,"column":4},"end":{"line":80,"column":4}}]},"8":{"line":94,"type":"if","locations":[{"start":{"line":94,"column":4},"end":{"line":94,"column":4}},{"start":{"line":94,"column":4},"end":{"line":94,"column":4}}]},"9":{"line":96,"type":"if","locations":[{"start":{"line":96,"column":11},"end":{"line":96,"column":11}},{"start":{"line":96,"column":11},"end":{"line":96,"column":11}}]},"10":{"line":102,"type":"if","locations":[{"start":{"line":102,"column":8},"end":{"line":102,"column":8}},{"start":{"line":102,"column":8},"end":{"line":102,"column":8}}]},"11":{"line":120,"type":"if","locations":[{"start":{"line":120,"column":8},"end":{"line":120,"column":8}},{"start":{"line":120,"column":8},"end":{"line":120,"column":8}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/movies.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/movies.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1},"b":{},"f":{},"fnMap":{},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}},"3":{"start":{"line":3,"column":0},"end":{"line":3,"column":49}},"4":{"start":{"line":6,"column":0},"end":{"line":6,"column":37}},"5":{"start":{"line":7,"column":0},"end":{"line":7,"column":52}},"6":{"start":{"line":8,"column":0},"end":{"line":8,"column":61}},"7":{"start":{"line":9,"column":0},"end":{"line":9,"column":58}},"8":{"start":{"line":12,"column":0},"end":{"line":12,"column":24}}},"branchMap":{}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/movies.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/movies.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0},"fnMap":{"1":{"name":"(anonymous_1)","line":6,"loc":{"start":{"line":6,"column":12},"end":{"line":6,"column":31}}},"2":{"name":"(anonymous_2)","line":7,"loc":{"start":{"line":7,"column":12},"end":{"line":7,"column":36}}},"3":{"name":"(anonymous_3)","line":17,"loc":{"start":{"line":17,"column":15},"end":{"line":17,"column":34}}},"4":{"name":"(anonymous_4)","line":18,"loc":{"start":{"line":18,"column":58},"end":{"line":18,"column":80}}},"5":{"name":"(anonymous_5)","line":29,"loc":{"start":{"line":29,"column":22},"end":{"line":29,"column":41}}},"6":{"name":"(anonymous_6)","line":30,"loc":{"start":{"line":30,"column":41},"end":{"line":30,"column":70}}},"7":{"name":"(anonymous_7)","line":40,"loc":{"start":{"line":40,"column":19},"end":{"line":40,"column":38}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":48}},"3":{"start":{"line":5,"column":0},"end":{"line":43,"column":1}},"4":{"start":{"line":7,"column":2},"end":{"line":14,"column":4}},"5":{"start":{"line":8,"column":3},"end":{"line":13,"column":4}},"6":{"start":{"line":9,"column":4},"end":{"line":9,"column":74}},"7":{"start":{"line":10,"column":4},"end":{"line":10,"column":21}},"8":{"start":{"line":12,"column":4},"end":{"line":12,"column":20}},"9":{"start":{"line":18,"column":2},"end":{"line":26,"column":4}},"10":{"start":{"line":19,"column":3},"end":{"line":24,"column":4}},"11":{"start":{"line":20,"column":4},"end":{"line":20,"column":40}},"12":{"start":{"line":21,"column":4},"end":{"line":21,"column":21}},"13":{"start":{"line":23,"column":4},"end":{"line":23,"column":18}},"14":{"start":{"line":30,"column":3},"end":{"line":37,"column":4}},"15":{"start":{"line":31,"column":3},"end":{"line":36,"column":4}},"16":{"start":{"line":32,"column":4},"end":{"line":32,"column":61}},"17":{"start":{"line":33,"column":4},"end":{"line":33,"column":21}},"18":{"start":{"line":35,"column":5},"end":{"line":35,"column":26}},"19":{"start":{"line":45,"column":0},"end":{"line":45,"column":33}}},"branchMap":{"1":{"line":8,"type":"if","locations":[{"start":{"line":8,"column":3},"end":{"line":8,"column":3}},{"start":{"line":8,"column":3},"end":{"line":8,"column":3}}]},"2":{"line":19,"type":"if","locations":[{"start":{"line":19,"column":3},"end":{"line":19,"column":3}},{"start":{"line":19,"column":3},"end":{"line":19,"column":3}}]},"3":{"line":31,"type":"if","locations":[{"start":{"line":31,"column":3},"end":{"line":31,"column":3}},{"start":{"line":31,"column":3},"end":{"line":31,"column":3}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/movies_model.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/movies_model.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":1,"7":0,"8":0,"9":0,"10":0,"11":0,"12":1,"13":0,"14":0,"15":0,"16":0,"17":1,"18":0,"19":0,"20":0,"21":0,"22":0,"23":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0},"fnMap":{"1":{"name":"(anonymous_1)","line":4,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":39}}},"2":{"name":"(anonymous_2)","line":9,"loc":{"start":{"line":9,"column":12},"end":{"line":9,"column":31}}},"3":{"name":"(anonymous_3)","line":10,"loc":{"start":{"line":10,"column":17},"end":{"line":10,"column":41}}},"4":{"name":"(anonymous_4)","line":14,"loc":{"start":{"line":14,"column":32},"end":{"line":14,"column":48}}},"5":{"name":"(anonymous_5)","line":21,"loc":{"start":{"line":21,"column":18},"end":{"line":21,"column":44}}},"6":{"name":"(anonymous_6)","line":22,"loc":{"start":{"line":22,"column":36},"end":{"line":22,"column":59}}},"7":{"name":"(anonymous_7)","line":33,"loc":{"start":{"line":33,"column":13},"end":{"line":33,"column":46}}},"8":{"name":"(anonymous_8)","line":39,"loc":{"start":{"line":39,"column":5},"end":{"line":39,"column":29}}},"9":{"name":"(anonymous_9)","line":43,"loc":{"start":{"line":43,"column":33},"end":{"line":43,"column":50}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}},"3":{"start":{"line":4,"column":0},"end":{"line":7,"column":1}},"4":{"start":{"line":5,"column":2},"end":{"line":5,"column":21}},"5":{"start":{"line":6,"column":2},"end":{"line":6,"column":29}},"6":{"start":{"line":9,"column":0},"end":{"line":19,"column":2}},"7":{"start":{"line":10,"column":2},"end":{"line":18,"column":4}},"8":{"start":{"line":11,"column":4},"end":{"line":17,"column":5}},"9":{"start":{"line":12,"column":6},"end":{"line":12,"column":75}},"10":{"start":{"line":14,"column":6},"end":{"line":16,"column":9}},"11":{"start":{"line":15,"column":8},"end":{"line":15,"column":38}},"12":{"start":{"line":21,"column":0},"end":{"line":31,"column":2}},"13":{"start":{"line":22,"column":2},"end":{"line":30,"column":4}},"14":{"start":{"line":24,"column":4},"end":{"line":29,"column":5}},"15":{"start":{"line":26,"column":6},"end":{"line":26,"column":65}},"16":{"start":{"line":28,"column":6},"end":{"line":28,"column":27}},"17":{"start":{"line":33,"column":0},"end":{"line":48,"column":1}},"18":{"start":{"line":35,"column":1},"end":{"line":47,"column":4}},"19":{"start":{"line":40,"column":4},"end":{"line":46,"column":5}},"20":{"start":{"line":41,"column":6},"end":{"line":41,"column":74}},"21":{"start":{"line":43,"column":6},"end":{"line":45,"column":9}},"22":{"start":{"line":44,"column":8},"end":{"line":44,"column":20}},"23":{"start":{"line":50,"column":0},"end":{"line":50,"column":23}}},"branchMap":{"1":{"line":11,"type":"if","locations":[{"start":{"line":11,"column":4},"end":{"line":11,"column":4}},{"start":{"line":11,"column":4},"end":{"line":11,"column":4}}]},"2":{"line":11,"type":"binary-expr","locations":[{"start":{"line":11,"column":8},"end":{"line":11,"column":13}},{"start":{"line":11,"column":16},"end":{"line":11,"column":23}}]},"3":{"line":12,"type":"binary-expr","locations":[{"start":{"line":12,"column":15},"end":{"line":12,"column":20}},{"start":{"line":12,"column":24},"end":{"line":12,"column":62}}]},"4":{"line":24,"type":"if","locations":[{"start":{"line":24,"column":4},"end":{"line":24,"column":4}},{"start":{"line":24,"column":4},"end":{"line":24,"column":4}}]},"5":{"line":24,"type":"binary-expr","locations":[{"start":{"line":24,"column":8},"end":{"line":24,"column":13}},{"start":{"line":24,"column":17},"end":{"line":24,"column":23}}]},"6":{"line":26,"type":"binary-expr","locations":[{"start":{"line":26,"column":15},"end":{"line":26,"column":20}},{"start":{"line":26,"column":24},"end":{"line":26,"column":52}}]},"7":{"line":40,"type":"if","locations":[{"start":{"line":40,"column":4},"end":{"line":40,"column":4}},{"start":{"line":40,"column":4},"end":{"line":40,"column":4}}]},"8":{"line":40,"type":"binary-expr","locations":[{"start":{"line":40,"column":8},"end":{"line":40,"column":13}},{"start":{"line":40,"column":17},"end":{"line":40,"column":24}}]},"9":{"line":41,"type":"binary-expr","locations":[{"start":{"line":41,"column":15},"end":{"line":41,"column":20}},{"start":{"line":41,"column":24},"end":{"line":41,"column":62}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/rentals.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/rentals.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1},"b":{},"f":{},"fnMap":{},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}},"3":{"start":{"line":3,"column":0},"end":{"line":3,"column":50}},"4":{"start":{"line":5,"column":0},"end":{"line":5,"column":52}},"5":{"start":{"line":6,"column":0},"end":{"line":6,"column":44}},"6":{"start":{"line":7,"column":0},"end":{"line":7,"column":63}},"7":{"start":{"line":9,"column":0},"end":{"line":9,"column":74}},"8":{"start":{"line":12,"column":0},"end":{"line":12,"column":54}},"9":{"start":{"line":17,"column":0},"end":{"line":17,"column":24}}},"branchMap":{}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/rentals.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/rentals.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0},"fnMap":{"1":{"name":"(anonymous_1)","line":5,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":32}}},"2":{"name":"(anonymous_2)","line":6,"loc":{"start":{"line":6,"column":36},"end":{"line":6,"column":59}}},"3":{"name":"(anonymous_3)","line":11,"loc":{"start":{"line":11,"column":41},"end":{"line":11,"column":70}}},"4":{"name":"(anonymous_4)","line":26,"loc":{"start":{"line":26,"column":22},"end":{"line":26,"column":41}}},"5":{"name":"(anonymous_5)","line":27,"loc":{"start":{"line":27,"column":41},"end":{"line":27,"column":70}}},"6":{"name":"(anonymous_6)","line":37,"loc":{"start":{"line":37,"column":21},"end":{"line":37,"column":46}}},"7":{"name":"(anonymous_7)","line":38,"loc":{"start":{"line":38,"column":62},"end":{"line":38,"column":91}}},"8":{"name":"(anonymous_8)","line":48,"loc":{"start":{"line":48,"column":19},"end":{"line":48,"column":38}}},"9":{"name":"(anonymous_9)","line":49,"loc":{"start":{"line":49,"column":34},"end":{"line":49,"column":60}}},"10":{"name":"(anonymous_10)","line":60,"loc":{"start":{"line":60,"column":20},"end":{"line":60,"column":39}}},"11":{"name":"(anonymous_11)","line":61,"loc":{"start":{"line":61,"column":20},"end":{"line":61,"column":46}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":46}},"3":{"start":{"line":4,"column":0},"end":{"line":70,"column":1}},"4":{"start":{"line":6,"column":2},"end":{"line":23,"column":4}},"5":{"start":{"line":7,"column":3},"end":{"line":21,"column":4}},"6":{"start":{"line":8,"column":4},"end":{"line":8,"column":41}},"7":{"start":{"line":9,"column":4},"end":{"line":9,"column":21}},"8":{"start":{"line":11,"column":4},"end":{"line":20,"column":6}},"9":{"start":{"line":12,"column":5},"end":{"line":18,"column":6}},"10":{"start":{"line":19,"column":5},"end":{"line":19,"column":26}},"11":{"start":{"line":27,"column":3},"end":{"line":34,"column":4}},"12":{"start":{"line":28,"column":3},"end":{"line":33,"column":4}},"13":{"start":{"line":29,"column":4},"end":{"line":29,"column":61}},"14":{"start":{"line":30,"column":4},"end":{"line":30,"column":21}},"15":{"start":{"line":32,"column":5},"end":{"line":32,"column":26}},"16":{"start":{"line":38,"column":2},"end":{"line":45,"column":5}},"17":{"start":{"line":39,"column":3},"end":{"line":44,"column":4}},"18":{"start":{"line":40,"column":4},"end":{"line":40,"column":61}},"19":{"start":{"line":41,"column":4},"end":{"line":41,"column":21}},"20":{"start":{"line":43,"column":4},"end":{"line":43,"column":25}},"21":{"start":{"line":49,"column":2},"end":{"line":56,"column":5}},"22":{"start":{"line":50,"column":3},"end":{"line":55,"column":4}},"23":{"start":{"line":51,"column":4},"end":{"line":51,"column":61}},"24":{"start":{"line":52,"column":4},"end":{"line":52,"column":21}},"25":{"start":{"line":54,"column":4},"end":{"line":54,"column":22}},"26":{"start":{"line":61,"column":2},"end":{"line":68,"column":5}},"27":{"start":{"line":62,"column":3},"end":{"line":67,"column":4}},"28":{"start":{"line":63,"column":4},"end":{"line":63,"column":33}},"29":{"start":{"line":64,"column":4},"end":{"line":64,"column":21}},"30":{"start":{"line":66,"column":4},"end":{"line":66,"column":22}},"31":{"start":{"line":72,"column":0},"end":{"line":72,"column":34}}},"branchMap":{"1":{"line":7,"type":"if","locations":[{"start":{"line":7,"column":3},"end":{"line":7,"column":3}},{"start":{"line":7,"column":3},"end":{"line":7,"column":3}}]},"2":{"line":28,"type":"if","locations":[{"start":{"line":28,"column":3},"end":{"line":28,"column":3}},{"start":{"line":28,"column":3},"end":{"line":28,"column":3}}]},"3":{"line":39,"type":"if","locations":[{"start":{"line":39,"column":3},"end":{"line":39,"column":3}},{"start":{"line":39,"column":3},"end":{"line":39,"column":3}}]},"4":{"line":50,"type":"if","locations":[{"start":{"line":50,"column":3},"end":{"line":50,"column":3}},{"start":{"line":50,"column":3},"end":{"line":50,"column":3}}]},"5":{"line":62,"type":"if","locations":[{"start":{"line":62,"column":3},"end":{"line":62,"column":3}},{"start":{"line":62,"column":3},"end":{"line":62,"column":3}}]}}}} \ No newline at end of file diff --git a/coverage/lcov-report/VideoStoreAPI/app.js.html b/coverage/lcov-report/VideoStoreAPI/app.js.html index 36d2cff2e..c828a0ac5 100644 --- a/coverage/lcov-report/VideoStoreAPI/app.js.html +++ b/coverage/lcov-report/VideoStoreAPI/app.js.html @@ -292,7 +292,7 @@

diff --git a/coverage/lcov-report/VideoStoreAPI/controllers/customers.js.html b/coverage/lcov-report/VideoStoreAPI/controllers/customers.js.html index 9495977c4..9746ad3a2 100644 --- a/coverage/lcov-report/VideoStoreAPI/controllers/customers.js.html +++ b/coverage/lcov-report/VideoStoreAPI/controllers/customers.js.html @@ -94,8 +94,7 @@

49 50 51 -52 -531× +521× 1×     @@ -112,7 +111,6 @@

      -        @@ -161,7 +159,6 @@

res.json(customers) } }) -  }, // customer id, sort column, offest ????? subsetCustomers: function(req, res) { @@ -170,7 +167,7 @@

var err = new Error("No such data"); err.status = 404; } else { - res.json(data) + res.json(data) } }) }, @@ -182,7 +179,7 @@

var err = new Error("No such data"); err.status = 404; } else { - res.json(data) + res.json(data) } }) }, @@ -193,7 +190,7 @@

var err = new Error("No such data"); err.status = 404; } else { - res.json(data) + res.json(data) } }) } @@ -205,7 +202,7 @@

diff --git a/coverage/lcov-report/VideoStoreAPI/controllers/index.html b/coverage/lcov-report/VideoStoreAPI/controllers/index.html index fe852a326..058c63da4 100644 --- a/coverage/lcov-report/VideoStoreAPI/controllers/index.html +++ b/coverage/lcov-report/VideoStoreAPI/controllers/index.html @@ -103,7 +103,7 @@

diff --git a/coverage/lcov-report/VideoStoreAPI/controllers/movies.js.html b/coverage/lcov-report/VideoStoreAPI/controllers/movies.js.html index 6a6692dbf..29aecc47c 100644 --- a/coverage/lcov-report/VideoStoreAPI/controllers/movies.js.html +++ b/coverage/lcov-report/VideoStoreAPI/controllers/movies.js.html @@ -184,7 +184,7 @@

diff --git a/coverage/lcov-report/VideoStoreAPI/controllers/rentals.js.html b/coverage/lcov-report/VideoStoreAPI/controllers/rentals.js.html index fa290b53a..bd7954f28 100644 --- a/coverage/lcov-report/VideoStoreAPI/controllers/rentals.js.html +++ b/coverage/lcov-report/VideoStoreAPI/controllers/rentals.js.html @@ -265,7 +265,7 @@

diff --git a/coverage/lcov-report/VideoStoreAPI/index.html b/coverage/lcov-report/VideoStoreAPI/index.html index a56d5ab12..e3a5b7493 100644 --- a/coverage/lcov-report/VideoStoreAPI/index.html +++ b/coverage/lcov-report/VideoStoreAPI/index.html @@ -77,7 +77,7 @@

diff --git a/coverage/lcov-report/VideoStoreAPI/models/customers_model.js.html b/coverage/lcov-report/VideoStoreAPI/models/customers_model.js.html index 528e0e8b7..9bd8cd2a0 100644 --- a/coverage/lcov-report/VideoStoreAPI/models/customers_model.js.html +++ b/coverage/lcov-report/VideoStoreAPI/models/customers_model.js.html @@ -20,28 +20,28 @@

- 35.29% + 64.71% Statements - 6/17 + 11/17
- 0% + 25% Branches - 0/12 + 3/12
- 0% + 57.14% Functions - 0/7 + 4/7
- 35.29% + 64.71% Lines - 6/17 + 11/17
-
+

-	
-	
-	
-	
-	
-	
-	
-	
-	
-	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
@@ -103,7 +103,7 @@ 

diff --git a/coverage/lcov-report/VideoStoreAPI/models/movies_model.js.html b/coverage/lcov-report/VideoStoreAPI/models/movies_model.js.html index 4e2c26522..402ca275f 100644 --- a/coverage/lcov-report/VideoStoreAPI/models/movies_model.js.html +++ b/coverage/lcov-report/VideoStoreAPI/models/movies_model.js.html @@ -199,7 +199,7 @@

diff --git a/coverage/lcov-report/VideoStoreAPI/models/rentals_model.js.html b/coverage/lcov-report/VideoStoreAPI/models/rentals_model.js.html index 552f16ffd..0250a52f1 100644 --- a/coverage/lcov-report/VideoStoreAPI/models/rentals_model.js.html +++ b/coverage/lcov-report/VideoStoreAPI/models/rentals_model.js.html @@ -439,7 +439,7 @@

diff --git a/coverage/lcov-report/VideoStoreAPI/routes/customers.js.html b/coverage/lcov-report/VideoStoreAPI/routes/customers.js.html index c97e9bfea..be58394a5 100644 --- a/coverage/lcov-report/VideoStoreAPI/routes/customers.js.html +++ b/coverage/lcov-report/VideoStoreAPI/routes/customers.js.html @@ -85,7 +85,7 @@

diff --git a/coverage/lcov-report/VideoStoreAPI/routes/index.html b/coverage/lcov-report/VideoStoreAPI/routes/index.html index 222b4200a..b4bc1eb4d 100644 --- a/coverage/lcov-report/VideoStoreAPI/routes/index.html +++ b/coverage/lcov-report/VideoStoreAPI/routes/index.html @@ -116,7 +116,7 @@

diff --git a/coverage/lcov-report/VideoStoreAPI/routes/index.js.html b/coverage/lcov-report/VideoStoreAPI/routes/index.js.html index c20955912..4ac236139 100644 --- a/coverage/lcov-report/VideoStoreAPI/routes/index.js.html +++ b/coverage/lcov-report/VideoStoreAPI/routes/index.js.html @@ -91,7 +91,7 @@

diff --git a/coverage/lcov-report/VideoStoreAPI/routes/movies.js.html b/coverage/lcov-report/VideoStoreAPI/routes/movies.js.html index 04c54fb61..82ad9c89e 100644 --- a/coverage/lcov-report/VideoStoreAPI/routes/movies.js.html +++ b/coverage/lcov-report/VideoStoreAPI/routes/movies.js.html @@ -85,7 +85,7 @@

diff --git a/coverage/lcov-report/VideoStoreAPI/routes/rentals.js.html b/coverage/lcov-report/VideoStoreAPI/routes/rentals.js.html index 15a12de6d..16b890e9b 100644 --- a/coverage/lcov-report/VideoStoreAPI/routes/rentals.js.html +++ b/coverage/lcov-report/VideoStoreAPI/routes/rentals.js.html @@ -100,7 +100,7 @@

diff --git a/coverage/lcov-report/index.html b/coverage/lcov-report/index.html index c4c224cdb..8f7c27b86 100644 --- a/coverage/lcov-report/index.html +++ b/coverage/lcov-report/index.html @@ -20,24 +20,24 @@

- 39.43% + 41.46% Statements - 97/246 + 102/246
- 1.22% + 4.88% Branches - 1/82 + 4/82
- 0% + 6.06% Functions - 0/66 + 4/66
- 39.43% + 41.46% Lines - 97/246 + 102/246
@@ -86,15 +86,15 @@

- - - - - - - - - + + + + + + + + + @@ -116,7 +116,7 @@

diff --git a/coverage/lcov.info b/coverage/lcov.info index 096badf70..e470aa69a 100644 --- a/coverage/lcov.info +++ b/coverage/lcov.info @@ -98,12 +98,12 @@ TN: SF:/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/customers.js FN:6,(anonymous_1) FN:7,(anonymous_2) -FN:18,(anonymous_3) -FN:19,(anonymous_4) -FN:30,(anonymous_5) -FN:31,(anonymous_6) -FN:41,(anonymous_7) -FN:42,(anonymous_8) +FN:17,(anonymous_3) +FN:18,(anonymous_4) +FN:29,(anonymous_5) +FN:30,(anonymous_6) +FN:40,(anonymous_7) +FN:41,(anonymous_8) FNF:8 FNH:0 FNDA:0,(anonymous_1) @@ -122,32 +122,32 @@ DA:8,0 DA:9,0 DA:10,0 DA:12,0 +DA:18,0 DA:19,0 DA:20,0 DA:21,0 -DA:22,0 -DA:24,0 +DA:23,0 +DA:30,0 DA:31,0 DA:32,0 DA:33,0 -DA:34,0 -DA:36,0 +DA:35,0 +DA:41,0 DA:42,0 DA:43,0 DA:44,0 -DA:45,0 -DA:47,0 -DA:52,1 +DA:46,0 +DA:51,1 LF:24 LH:4 BRDA:8,1,0,0 BRDA:8,1,1,0 -BRDA:20,2,0,0 -BRDA:20,2,1,0 -BRDA:32,3,0,0 -BRDA:32,3,1,0 -BRDA:43,4,0,0 -BRDA:43,4,1,0 +BRDA:19,2,0,0 +BRDA:19,2,1,0 +BRDA:31,3,0,0 +BRDA:31,3,1,0 +BRDA:42,4,0,0 +BRDA:42,4,1,0 BRF:8 BRH:0 end_of_record @@ -161,24 +161,24 @@ FN:20,(anonymous_5) FN:26,(anonymous_6) FN:30,(anonymous_7) FNF:7 -FNH:0 -FNDA:0,(anonymous_1) -FNDA:0,(anonymous_2) -FNDA:0,(anonymous_3) -FNDA:0,(anonymous_4) +FNH:4 +FNDA:400,(anonymous_1) +FNDA:2,(anonymous_2) +FNDA:2,(anonymous_3) +FNDA:400,(anonymous_4) FNDA:0,(anonymous_5) FNDA:0,(anonymous_6) FNDA:0,(anonymous_7) DA:1,1 DA:2,1 DA:4,1 -DA:5,0 +DA:5,400 DA:8,1 -DA:9,0 -DA:10,0 +DA:9,2 +DA:10,2 DA:11,0 -DA:13,0 -DA:14,0 +DA:13,2 +DA:14,400 DA:20,1 DA:22,0 DA:27,0 @@ -187,11 +187,11 @@ DA:30,0 DA:31,0 DA:37,1 LF:17 -LH:6 +LH:11 BRDA:10,1,0,0 -BRDA:10,1,1,0 -BRDA:10,2,0,0 -BRDA:10,2,1,0 +BRDA:10,1,1,2 +BRDA:10,2,0,2 +BRDA:10,2,1,2 BRDA:11,3,0,0 BRDA:11,3,1,0 BRDA:27,4,0,0 @@ -201,7 +201,7 @@ BRDA:27,5,1,0 BRDA:28,6,0,0 BRDA:28,6,1,0 BRF:12 -BRH:0 +BRH:3 end_of_record TN: SF:/Users/leahpetersen/C5/projects/VideoStoreAPI/models/rentals_model.js diff --git a/npm-debug.log b/npm-debug.log new file mode 100644 index 000000000..556121583 --- /dev/null +++ b/npm-debug.log @@ -0,0 +1,49 @@ +0 info it worked if it ends with ok +1 verbose cli [ '/usr/local/Cellar/node/6.2.1/bin/node', +1 verbose cli '/usr/local/bin/npm', +1 verbose cli 'run', +1 verbose cli 'test' ] +2 info using npm@3.9.3 +3 info using node@v6.2.1 +4 verbose run-script [ 'pretest', 'test', 'posttest' ] +5 info lifecycle video-store-api@0.0.0~pretest: video-store-api@0.0.0 +6 silly lifecycle video-store-api@0.0.0~pretest: no script for pretest, continuing +7 info lifecycle video-store-api@0.0.0~test: video-store-api@0.0.0 +8 verbose lifecycle video-store-api@0.0.0~test: unsafe-perm in lifecycle true +9 verbose lifecycle video-store-api@0.0.0~test: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/leahpetersen/C5/projects/VideoStoreAPI/node_modules/.bin:/usr/local/Cellar/node/6.2.1/bin:/Users/leahpetersen/google-cloud-sdk/bin:/Users/leahpetersen/.rvm/gems/ruby-2.3.1/bin:/Users/leahpetersen/.rvm/gems/ruby-2.3.1@global/bin:/Users/leahpetersen/.rvm/rubies/ruby-2.3.1/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/leahpetersen/.rvm/bin:/Users/leahpetersen/.rvm/bin:/Users/leahpetersen/.rvm/bin +10 verbose lifecycle video-store-api@0.0.0~test: CWD: /Users/leahpetersen/C5/projects/VideoStoreAPI +11 silly lifecycle video-store-api@0.0.0~test: Args: [ '-c', +11 silly lifecycle 'clear; ./node_modules/.bin/istanbul cover -x \'spec/**/*\' -- ./node_modules/.bin/jasmine-node --captureExceptions --verbose spec/' ] +12 silly lifecycle video-store-api@0.0.0~test: Returned: code: 1 signal: null +13 info lifecycle video-store-api@0.0.0~test: Failed to exec test script +14 verbose stack Error: video-store-api@0.0.0 test: `clear; ./node_modules/.bin/istanbul cover -x 'spec/**/*' -- ./node_modules/.bin/jasmine-node --captureExceptions --verbose spec/` +14 verbose stack Exit status 1 +14 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:245:16) +14 verbose stack at emitTwo (events.js:106:13) +14 verbose stack at EventEmitter.emit (events.js:191:7) +14 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14) +14 verbose stack at emitTwo (events.js:106:13) +14 verbose stack at ChildProcess.emit (events.js:191:7) +14 verbose stack at maybeClose (internal/child_process.js:852:16) +14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5) +15 verbose pkgid video-store-api@0.0.0 +16 verbose cwd /Users/leahpetersen/C5/projects/VideoStoreAPI +17 error Darwin 15.5.0 +18 error argv "/usr/local/Cellar/node/6.2.1/bin/node" "/usr/local/bin/npm" "run" "test" +19 error node v6.2.1 +20 error npm v3.9.3 +21 error code ELIFECYCLE +22 error video-store-api@0.0.0 test: `clear; ./node_modules/.bin/istanbul cover -x 'spec/**/*' -- ./node_modules/.bin/jasmine-node --captureExceptions --verbose spec/` +22 error Exit status 1 +23 error Failed at the video-store-api@0.0.0 test script 'clear; ./node_modules/.bin/istanbul cover -x 'spec/**/*' -- ./node_modules/.bin/jasmine-node --captureExceptions --verbose spec/'. +23 error Make sure you have the latest version of node.js and npm installed. +23 error If you do, this is most likely a problem with the video-store-api package, +23 error not with npm itself. +23 error Tell the author that this fails on your system: +23 error clear; ./node_modules/.bin/istanbul cover -x 'spec/**/*' -- ./node_modules/.bin/jasmine-node --captureExceptions --verbose spec/ +23 error You can get information on how to open an issue for this project with: +23 error npm bugs video-store-api +23 error Or if that isn't available, you can get their info via: +23 error npm owner ls video-store-api +23 error There is likely additional logging output above. +24 verbose exit [ 1, true ] diff --git a/spec/models/customers_model.spec.js b/spec/models/customers_model.spec.js index e53f09d89..537088a02 100644 --- a/spec/models/customers_model.spec.js +++ b/spec/models/customers_model.spec.js @@ -1,44 +1,34 @@ var app = require("../../app"); var db = app.get("db"); -var Account = require('../../models/customers_model') - - -// below are tests from in class demo - -// describe('Account', function () { -// var account1, account2 -// var initialBalance1 = 100.0 -// var initialBalance2 = 0 - -// beforeEach(function (done) { -// Account.create(initialBalance1, function(err, account) { -// account1 = account -// done() -// }) -// }) - -// afterEach(function () { -// // delete all the accounts I created - -// db.end() -// // Account.close_connection() -// }) - -// describe('#getBalance', function () { -// it('should return positive balances', function (done) { -// account1.getBalance(function (error, balance) { -// expect(error).toBeNull -// expect(balance).toEqual('$100.00') -// done() -// }) -// }) - -// it('should not break, I guess', function (done) { -// account1.getBalance(function (error, balance) { -// expect(error).toBeNull -// expect(balance).toEqual('$100.00') -// done() -// }) -// }) -// }) -// }) +var Customer = require('../../models/customers_model') + + + +// describe('Customer', function () { + +describe('#all', function () { + + it('should return an array of customers', function (done) { + Customer.all(function (error, data) { + expect(typeof data).toEqual('object') + done() + }) + }) + + // it('should return an array of customers', function (done) { + // Customer.all(function (error, data) { + // expect(typeof data).toEqual('array') + // done() + // }) + // }) +}) + +describe('#sort', function () { + + it('should return an array of customers', function (done) { + Customer.all(function (error, data) { + expect(typeof data).toEqual('object') + done() + }) + }) +}) \ No newline at end of file From 17f324b73aabc89cb5d6fc1fea9a8a41c2c15761 Mon Sep 17 00:00:00 2001 From: Leah Date: Thu, 23 Jun 2016 11:29:34 -0700 Subject: [PATCH 50/69] added test for customer sort model method --- coverage/coverage.json | 2 +- .../lcov-report/VideoStoreAPI/app.js.html | 2 +- .../controllers/customers.js.html | 2 +- .../VideoStoreAPI/controllers/index.html | 2 +- .../VideoStoreAPI/controllers/movies.js.html | 2 +- .../VideoStoreAPI/controllers/rentals.js.html | 2 +- coverage/lcov-report/VideoStoreAPI/index.html | 2 +- .../models/customers_model.js.html | 50 +++++++++---------- .../VideoStoreAPI/models/index.html | 38 +++++++------- .../VideoStoreAPI/models/movies_model.js.html | 2 +- .../models/rentals_model.js.html | 2 +- .../VideoStoreAPI/routes/customers.js.html | 2 +- .../VideoStoreAPI/routes/index.html | 2 +- .../VideoStoreAPI/routes/index.js.html | 2 +- .../VideoStoreAPI/routes/movies.js.html | 2 +- .../VideoStoreAPI/routes/rentals.js.html | 2 +- coverage/lcov-report/index.html | 36 ++++++------- coverage/lcov.info | 50 +++++++++---------- npm-debug.log | 49 ------------------ spec/models/customers_model.spec.js | 2 +- 20 files changed, 102 insertions(+), 151 deletions(-) delete mode 100644 npm-debug.log diff --git a/coverage/coverage.json b/coverage/coverage.json index 42050bfda..f4a74afae 100644 --- a/coverage/coverage.json +++ b/coverage/coverage.json @@ -1 +1 @@ -{"/Users/leahpetersen/C5/projects/VideoStoreAPI/app.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/app.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":1,"19":1,"20":1,"21":1,"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":0,"29":0,"30":0,"31":1,"32":0,"33":0,"34":0,"35":1,"36":0,"37":0,"38":1},"b":{"1":[0,1],"2":[0,0],"3":[0,0]},"f":{"1":0,"2":0,"3":0},"fnMap":{"1":{"name":"(anonymous_1)","line":50,"loc":{"start":{"line":50,"column":8},"end":{"line":50,"column":33}}},"2":{"name":"(anonymous_2)","line":61,"loc":{"start":{"line":61,"column":10},"end":{"line":61,"column":40}}},"3":{"name":"(anonymous_3)","line":72,"loc":{"start":{"line":72,"column":8},"end":{"line":72,"column":38}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":27}},"3":{"start":{"line":3,"column":0},"end":{"line":3,"column":39}},"4":{"start":{"line":4,"column":0},"end":{"line":4,"column":31}},"5":{"start":{"line":5,"column":0},"end":{"line":5,"column":44}},"6":{"start":{"line":6,"column":0},"end":{"line":6,"column":40}},"7":{"start":{"line":7,"column":0},"end":{"line":7,"column":33}},"8":{"start":{"line":8,"column":0},"end":{"line":8,"column":37}},"9":{"start":{"line":11,"column":0},"end":{"line":11,"column":76}},"10":{"start":{"line":16,"column":0},"end":{"line":16,"column":80}},"11":{"start":{"line":19,"column":0},"end":{"line":19,"column":31}},"12":{"start":{"line":23,"column":0},"end":{"line":23,"column":48}},"13":{"start":{"line":24,"column":0},"end":{"line":24,"column":31}},"14":{"start":{"line":28,"column":0},"end":{"line":28,"column":23}},"15":{"start":{"line":31,"column":0},"end":{"line":31,"column":27}},"16":{"start":{"line":32,"column":0},"end":{"line":32,"column":52}},"17":{"start":{"line":33,"column":0},"end":{"line":33,"column":24}},"18":{"start":{"line":34,"column":0},"end":{"line":34,"column":56}},"19":{"start":{"line":36,"column":0},"end":{"line":36,"column":42}},"20":{"start":{"line":37,"column":0},"end":{"line":37,"column":46}},"21":{"start":{"line":38,"column":0},"end":{"line":38,"column":43}},"22":{"start":{"line":39,"column":0},"end":{"line":39,"column":44}},"23":{"start":{"line":43,"column":0},"end":{"line":43,"column":21}},"24":{"start":{"line":44,"column":0},"end":{"line":44,"column":33}},"25":{"start":{"line":45,"column":0},"end":{"line":45,"column":27}},"26":{"start":{"line":46,"column":0},"end":{"line":46,"column":29}},"27":{"start":{"line":50,"column":0},"end":{"line":54,"column":3}},"28":{"start":{"line":51,"column":2},"end":{"line":51,"column":35}},"29":{"start":{"line":52,"column":2},"end":{"line":52,"column":19}},"30":{"start":{"line":53,"column":2},"end":{"line":53,"column":12}},"31":{"start":{"line":60,"column":0},"end":{"line":68,"column":1}},"32":{"start":{"line":61,"column":2},"end":{"line":67,"column":5}},"33":{"start":{"line":62,"column":4},"end":{"line":62,"column":34}},"34":{"start":{"line":63,"column":4},"end":{"line":66,"column":7}},"35":{"start":{"line":72,"column":0},"end":{"line":78,"column":3}},"36":{"start":{"line":73,"column":2},"end":{"line":73,"column":32}},"37":{"start":{"line":74,"column":2},"end":{"line":77,"column":5}},"38":{"start":{"line":81,"column":0},"end":{"line":81,"column":21}}},"branchMap":{"1":{"line":60,"type":"if","locations":[{"start":{"line":60,"column":0},"end":{"line":60,"column":0}},{"start":{"line":60,"column":0},"end":{"line":60,"column":0}}]},"2":{"line":62,"type":"binary-expr","locations":[{"start":{"line":62,"column":15},"end":{"line":62,"column":25}},{"start":{"line":62,"column":29},"end":{"line":62,"column":32}}]},"3":{"line":73,"type":"binary-expr","locations":[{"start":{"line":73,"column":13},"end":{"line":73,"column":23}},{"start":{"line":73,"column":27},"end":{"line":73,"column":30}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/index.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/index.js","s":{"1":1,"2":1,"3":1,"4":0,"5":1,"6":0,"7":1},"b":{},"f":{"1":0,"2":0},"fnMap":{"1":{"name":"(anonymous_1)","line":6,"loc":{"start":{"line":6,"column":16},"end":{"line":6,"column":41}}},"2":{"name":"(anonymous_2)","line":10,"loc":{"start":{"line":10,"column":20},"end":{"line":10,"column":45}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}},"3":{"start":{"line":6,"column":0},"end":{"line":8,"column":3}},"4":{"start":{"line":7,"column":2},"end":{"line":7,"column":40}},"5":{"start":{"line":10,"column":0},"end":{"line":12,"column":3}},"6":{"start":{"line":11,"column":2},"end":{"line":11,"column":49}},"7":{"start":{"line":14,"column":0},"end":{"line":14,"column":24}}},"branchMap":{}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/customers.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/customers.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1},"b":{},"f":{},"fnMap":{},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}},"3":{"start":{"line":3,"column":0},"end":{"line":3,"column":52}},"4":{"start":{"line":6,"column":0},"end":{"line":6,"column":40}},"5":{"start":{"line":7,"column":0},"end":{"line":7,"column":55}},"6":{"start":{"line":8,"column":0},"end":{"line":8,"column":67}},"7":{"start":{"line":9,"column":0},"end":{"line":9,"column":67}},"8":{"start":{"line":12,"column":0},"end":{"line":12,"column":24}}},"branchMap":{}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/customers.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/customers.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0},"fnMap":{"1":{"name":"(anonymous_1)","line":6,"loc":{"start":{"line":6,"column":15},"end":{"line":6,"column":34}}},"2":{"name":"(anonymous_2)","line":7,"loc":{"start":{"line":7,"column":15},"end":{"line":7,"column":42}}},"3":{"name":"(anonymous_3)","line":17,"loc":{"start":{"line":17,"column":18},"end":{"line":17,"column":37}}},"4":{"name":"(anonymous_4)","line":18,"loc":{"start":{"line":18,"column":61},"end":{"line":18,"column":83}}},"5":{"name":"(anonymous_5)","line":29,"loc":{"start":{"line":29,"column":22},"end":{"line":29,"column":41}}},"6":{"name":"(anonymous_6)","line":30,"loc":{"start":{"line":30,"column":51},"end":{"line":30,"column":73}}},"7":{"name":"(anonymous_7)","line":40,"loc":{"start":{"line":40,"column":22},"end":{"line":40,"column":41}}},"8":{"name":"(anonymous_8)","line":41,"loc":{"start":{"line":41,"column":48},"end":{"line":41,"column":70}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":48}},"3":{"start":{"line":5,"column":0},"end":{"line":50,"column":1}},"4":{"start":{"line":7,"column":2},"end":{"line":14,"column":4}},"5":{"start":{"line":8,"column":3},"end":{"line":13,"column":4}},"6":{"start":{"line":9,"column":4},"end":{"line":9,"column":76}},"7":{"start":{"line":10,"column":4},"end":{"line":10,"column":21}},"8":{"start":{"line":12,"column":4},"end":{"line":12,"column":23}},"9":{"start":{"line":18,"column":2},"end":{"line":25,"column":4}},"10":{"start":{"line":19,"column":3},"end":{"line":24,"column":4}},"11":{"start":{"line":20,"column":4},"end":{"line":20,"column":40}},"12":{"start":{"line":21,"column":4},"end":{"line":21,"column":21}},"13":{"start":{"line":23,"column":4},"end":{"line":23,"column":18}},"14":{"start":{"line":30,"column":2},"end":{"line":37,"column":4}},"15":{"start":{"line":31,"column":3},"end":{"line":36,"column":4}},"16":{"start":{"line":32,"column":4},"end":{"line":32,"column":40}},"17":{"start":{"line":33,"column":4},"end":{"line":33,"column":21}},"18":{"start":{"line":35,"column":4},"end":{"line":35,"column":18}},"19":{"start":{"line":41,"column":2},"end":{"line":48,"column":4}},"20":{"start":{"line":42,"column":3},"end":{"line":47,"column":4}},"21":{"start":{"line":43,"column":4},"end":{"line":43,"column":40}},"22":{"start":{"line":44,"column":4},"end":{"line":44,"column":21}},"23":{"start":{"line":46,"column":4},"end":{"line":46,"column":18}},"24":{"start":{"line":51,"column":0},"end":{"line":51,"column":36}}},"branchMap":{"1":{"line":8,"type":"if","locations":[{"start":{"line":8,"column":3},"end":{"line":8,"column":3}},{"start":{"line":8,"column":3},"end":{"line":8,"column":3}}]},"2":{"line":19,"type":"if","locations":[{"start":{"line":19,"column":3},"end":{"line":19,"column":3}},{"start":{"line":19,"column":3},"end":{"line":19,"column":3}}]},"3":{"line":31,"type":"if","locations":[{"start":{"line":31,"column":3},"end":{"line":31,"column":3}},{"start":{"line":31,"column":3},"end":{"line":31,"column":3}}]},"4":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":3},"end":{"line":42,"column":3}},{"start":{"line":42,"column":3},"end":{"line":42,"column":3}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/customers_model.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/customers_model.js","s":{"1":1,"2":1,"3":1,"4":400,"5":1,"6":2,"7":2,"8":0,"9":2,"10":400,"11":1,"12":0,"13":0,"14":0,"15":0,"16":0,"17":1},"b":{"1":[0,2],"2":[2,2],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0]},"f":{"1":400,"2":2,"3":2,"4":400,"5":0,"6":0,"7":0},"fnMap":{"1":{"name":"(anonymous_1)","line":4,"loc":{"start":{"line":4,"column":15},"end":{"line":4,"column":28}}},"2":{"name":"(anonymous_2)","line":8,"loc":{"start":{"line":8,"column":15},"end":{"line":8,"column":34}}},"3":{"name":"(anonymous_3)","line":9,"loc":{"start":{"line":9,"column":20},"end":{"line":9,"column":47}}},"4":{"name":"(anonymous_4)","line":13,"loc":{"start":{"line":13,"column":35},"end":{"line":13,"column":54}}},"5":{"name":"(anonymous_5)","line":20,"loc":{"start":{"line":20,"column":16},"end":{"line":20,"column":49}}},"6":{"name":"(anonymous_6)","line":26,"loc":{"start":{"line":26,"column":5},"end":{"line":26,"column":32}}},"7":{"name":"(anonymous_7)","line":30,"loc":{"start":{"line":30,"column":36},"end":{"line":30,"column":56}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}},"3":{"start":{"line":4,"column":0},"end":{"line":6,"column":1}},"4":{"start":{"line":5,"column":2},"end":{"line":5,"column":15}},"5":{"start":{"line":8,"column":0},"end":{"line":18,"column":2}},"6":{"start":{"line":9,"column":2},"end":{"line":17,"column":4}},"7":{"start":{"line":10,"column":4},"end":{"line":16,"column":5}},"8":{"start":{"line":11,"column":6},"end":{"line":11,"column":78}},"9":{"start":{"line":13,"column":6},"end":{"line":15,"column":9}},"10":{"start":{"line":14,"column":8},"end":{"line":14,"column":41}},"11":{"start":{"line":20,"column":0},"end":{"line":35,"column":1}},"12":{"start":{"line":22,"column":1},"end":{"line":34,"column":4}},"13":{"start":{"line":27,"column":4},"end":{"line":33,"column":5}},"14":{"start":{"line":28,"column":6},"end":{"line":28,"column":77}},"15":{"start":{"line":30,"column":6},"end":{"line":32,"column":9}},"16":{"start":{"line":31,"column":8},"end":{"line":31,"column":23}},"17":{"start":{"line":37,"column":0},"end":{"line":37,"column":26}}},"branchMap":{"1":{"line":10,"type":"if","locations":[{"start":{"line":10,"column":4},"end":{"line":10,"column":4}},{"start":{"line":10,"column":4},"end":{"line":10,"column":4}}]},"2":{"line":10,"type":"binary-expr","locations":[{"start":{"line":10,"column":8},"end":{"line":10,"column":13}},{"start":{"line":10,"column":16},"end":{"line":10,"column":26}}]},"3":{"line":11,"type":"binary-expr","locations":[{"start":{"line":11,"column":15},"end":{"line":11,"column":20}},{"start":{"line":11,"column":24},"end":{"line":11,"column":65}}]},"4":{"line":27,"type":"if","locations":[{"start":{"line":27,"column":4},"end":{"line":27,"column":4}},{"start":{"line":27,"column":4},"end":{"line":27,"column":4}}]},"5":{"line":27,"type":"binary-expr","locations":[{"start":{"line":27,"column":8},"end":{"line":27,"column":13}},{"start":{"line":27,"column":17},"end":{"line":27,"column":27}}]},"6":{"line":28,"type":"binary-expr","locations":[{"start":{"line":28,"column":15},"end":{"line":28,"column":20}},{"start":{"line":28,"column":24},"end":{"line":28,"column":65}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/rentals_model.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/rentals_model.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":1,"11":0,"12":0,"13":0,"14":0,"15":1,"16":0,"17":0,"18":0,"19":0,"20":1,"21":0,"22":0,"23":0,"24":0,"25":1,"26":0,"27":0,"28":0,"29":0,"30":1,"31":0,"32":0,"33":0,"34":0,"35":1,"36":0,"37":0,"38":0,"39":0,"40":0,"41":1,"42":0,"43":0,"44":0,"45":0,"46":1,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0},"fnMap":{"1":{"name":"(anonymous_1)","line":4,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":109}}},"2":{"name":"(anonymous_2)","line":14,"loc":{"start":{"line":14,"column":23},"end":{"line":14,"column":49}}},"3":{"name":"(anonymous_3)","line":15,"loc":{"start":{"line":15,"column":63},"end":{"line":15,"column":92}}},"4":{"name":"(anonymous_4)","line":24,"loc":{"start":{"line":24,"column":27},"end":{"line":24,"column":59}}},"5":{"name":"(anonymous_5)","line":25,"loc":{"start":{"line":25,"column":75},"end":{"line":25,"column":104}}},"6":{"name":"(anonymous_6)","line":34,"loc":{"start":{"line":34,"column":32},"end":{"line":34,"column":58}}},"7":{"name":"(anonymous_7)","line":35,"loc":{"start":{"line":35,"column":58},"end":{"line":35,"column":82}}},"8":{"name":"(anonymous_8)","line":44,"loc":{"start":{"line":44,"column":24},"end":{"line":44,"column":56}}},"9":{"name":"(anonymous_9)","line":45,"loc":{"start":{"line":45,"column":168},"end":{"line":45,"column":198}}},"10":{"name":"(anonymous_10)","line":54,"loc":{"start":{"line":54,"column":22},"end":{"line":54,"column":54}}},"11":{"name":"(anonymous_11)","line":55,"loc":{"start":{"line":55,"column":167},"end":{"line":55,"column":194}}},"12":{"name":"(anonymous_12)","line":64,"loc":{"start":{"line":64,"column":20},"end":{"line":64,"column":39}}},"13":{"name":"(anonymous_13)","line":66,"loc":{"start":{"line":66,"column":266},"end":{"line":66,"column":293}}},"14":{"name":"(anonymous_14)","line":74,"loc":{"start":{"line":74,"column":19},"end":{"line":74,"column":49}}},"15":{"name":"(anonymous_15)","line":79,"loc":{"start":{"line":79,"column":7},"end":{"line":79,"column":36}}},"16":{"name":"(anonymous_16)","line":88,"loc":{"start":{"line":88,"column":21},"end":{"line":88,"column":57}}},"17":{"name":"(anonymous_17)","line":93,"loc":{"start":{"line":93,"column":5},"end":{"line":93,"column":29}}},"18":{"name":"(anonymous_18)","line":101,"loc":{"start":{"line":101,"column":90},"end":{"line":101,"column":149}}},"19":{"name":"(anonymous_19)","line":119,"loc":{"start":{"line":119,"column":9},"end":{"line":119,"column":34}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}},"3":{"start":{"line":4,"column":0},"end":{"line":12,"column":2}},"4":{"start":{"line":5,"column":2},"end":{"line":5,"column":27}},"5":{"start":{"line":6,"column":2},"end":{"line":6,"column":33}},"6":{"start":{"line":7,"column":2},"end":{"line":7,"column":35}},"7":{"start":{"line":8,"column":2},"end":{"line":8,"column":27}},"8":{"start":{"line":9,"column":2},"end":{"line":9,"column":27}},"9":{"start":{"line":10,"column":2},"end":{"line":10,"column":37}},"10":{"start":{"line":14,"column":0},"end":{"line":22,"column":1}},"11":{"start":{"line":15,"column":2},"end":{"line":21,"column":4}},"12":{"start":{"line":16,"column":4},"end":{"line":20,"column":5}},"13":{"start":{"line":17,"column":6},"end":{"line":17,"column":33}},"14":{"start":{"line":19,"column":6},"end":{"line":19,"column":34}},"15":{"start":{"line":24,"column":0},"end":{"line":32,"column":1}},"16":{"start":{"line":25,"column":2},"end":{"line":31,"column":4}},"17":{"start":{"line":26,"column":4},"end":{"line":30,"column":5}},"18":{"start":{"line":27,"column":6},"end":{"line":27,"column":33}},"19":{"start":{"line":29,"column":6},"end":{"line":29,"column":34}},"20":{"start":{"line":34,"column":0},"end":{"line":42,"column":1}},"21":{"start":{"line":35,"column":2},"end":{"line":41,"column":4}},"22":{"start":{"line":36,"column":4},"end":{"line":40,"column":5}},"23":{"start":{"line":37,"column":6},"end":{"line":37,"column":22}},"24":{"start":{"line":39,"column":6},"end":{"line":39,"column":28}},"25":{"start":{"line":44,"column":0},"end":{"line":52,"column":1}},"26":{"start":{"line":45,"column":2},"end":{"line":51,"column":4}},"27":{"start":{"line":46,"column":4},"end":{"line":50,"column":5}},"28":{"start":{"line":47,"column":6},"end":{"line":47,"column":33}},"29":{"start":{"line":49,"column":6},"end":{"line":49,"column":35}},"30":{"start":{"line":54,"column":0},"end":{"line":62,"column":1}},"31":{"start":{"line":55,"column":2},"end":{"line":61,"column":4}},"32":{"start":{"line":56,"column":4},"end":{"line":60,"column":5}},"33":{"start":{"line":57,"column":6},"end":{"line":57,"column":33}},"34":{"start":{"line":59,"column":6},"end":{"line":59,"column":32}},"35":{"start":{"line":64,"column":0},"end":{"line":72,"column":1}},"36":{"start":{"line":65,"column":2},"end":{"line":65,"column":22}},"37":{"start":{"line":66,"column":2},"end":{"line":71,"column":7}},"38":{"start":{"line":67,"column":4},"end":{"line":69,"column":5}},"39":{"start":{"line":68,"column":6},"end":{"line":68,"column":33}},"40":{"start":{"line":70,"column":4},"end":{"line":70,"column":29}},"41":{"start":{"line":74,"column":0},"end":{"line":86,"column":1}},"42":{"start":{"line":75,"column":2},"end":{"line":85,"column":4}},"43":{"start":{"line":80,"column":4},"end":{"line":84,"column":5}},"44":{"start":{"line":81,"column":6},"end":{"line":81,"column":33}},"45":{"start":{"line":83,"column":6},"end":{"line":83,"column":34}},"46":{"start":{"line":88,"column":0},"end":{"line":128,"column":1}},"47":{"start":{"line":90,"column":2},"end":{"line":127,"column":5}},"48":{"start":{"line":94,"column":4},"end":{"line":98,"column":5}},"49":{"start":{"line":95,"column":6},"end":{"line":95,"column":29}},"50":{"start":{"line":96,"column":11},"end":{"line":98,"column":5}},"51":{"start":{"line":97,"column":6},"end":{"line":97,"column":52}},"52":{"start":{"line":101,"column":6},"end":{"line":126,"column":7}},"53":{"start":{"line":102,"column":8},"end":{"line":104,"column":9}},"54":{"start":{"line":103,"column":10},"end":{"line":103,"column":33}},"55":{"start":{"line":107,"column":6},"end":{"line":107,"column":27}},"56":{"start":{"line":108,"column":6},"end":{"line":108,"column":30}},"57":{"start":{"line":109,"column":6},"end":{"line":109,"column":37}},"58":{"start":{"line":112,"column":6},"end":{"line":125,"column":9}},"59":{"start":{"line":120,"column":8},"end":{"line":122,"column":9}},"60":{"start":{"line":121,"column":10},"end":{"line":121,"column":33}},"61":{"start":{"line":124,"column":8},"end":{"line":124,"column":38}},"62":{"start":{"line":130,"column":0},"end":{"line":130,"column":24}}},"branchMap":{"1":{"line":16,"type":"if","locations":[{"start":{"line":16,"column":4},"end":{"line":16,"column":4}},{"start":{"line":16,"column":4},"end":{"line":16,"column":4}}]},"2":{"line":26,"type":"if","locations":[{"start":{"line":26,"column":4},"end":{"line":26,"column":4}},{"start":{"line":26,"column":4},"end":{"line":26,"column":4}}]},"3":{"line":36,"type":"if","locations":[{"start":{"line":36,"column":4},"end":{"line":36,"column":4}},{"start":{"line":36,"column":4},"end":{"line":36,"column":4}}]},"4":{"line":46,"type":"if","locations":[{"start":{"line":46,"column":4},"end":{"line":46,"column":4}},{"start":{"line":46,"column":4},"end":{"line":46,"column":4}}]},"5":{"line":56,"type":"if","locations":[{"start":{"line":56,"column":4},"end":{"line":56,"column":4}},{"start":{"line":56,"column":4},"end":{"line":56,"column":4}}]},"6":{"line":67,"type":"if","locations":[{"start":{"line":67,"column":4},"end":{"line":67,"column":4}},{"start":{"line":67,"column":4},"end":{"line":67,"column":4}}]},"7":{"line":80,"type":"if","locations":[{"start":{"line":80,"column":4},"end":{"line":80,"column":4}},{"start":{"line":80,"column":4},"end":{"line":80,"column":4}}]},"8":{"line":94,"type":"if","locations":[{"start":{"line":94,"column":4},"end":{"line":94,"column":4}},{"start":{"line":94,"column":4},"end":{"line":94,"column":4}}]},"9":{"line":96,"type":"if","locations":[{"start":{"line":96,"column":11},"end":{"line":96,"column":11}},{"start":{"line":96,"column":11},"end":{"line":96,"column":11}}]},"10":{"line":102,"type":"if","locations":[{"start":{"line":102,"column":8},"end":{"line":102,"column":8}},{"start":{"line":102,"column":8},"end":{"line":102,"column":8}}]},"11":{"line":120,"type":"if","locations":[{"start":{"line":120,"column":8},"end":{"line":120,"column":8}},{"start":{"line":120,"column":8},"end":{"line":120,"column":8}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/movies.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/movies.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1},"b":{},"f":{},"fnMap":{},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}},"3":{"start":{"line":3,"column":0},"end":{"line":3,"column":49}},"4":{"start":{"line":6,"column":0},"end":{"line":6,"column":37}},"5":{"start":{"line":7,"column":0},"end":{"line":7,"column":52}},"6":{"start":{"line":8,"column":0},"end":{"line":8,"column":61}},"7":{"start":{"line":9,"column":0},"end":{"line":9,"column":58}},"8":{"start":{"line":12,"column":0},"end":{"line":12,"column":24}}},"branchMap":{}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/movies.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/movies.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0},"fnMap":{"1":{"name":"(anonymous_1)","line":6,"loc":{"start":{"line":6,"column":12},"end":{"line":6,"column":31}}},"2":{"name":"(anonymous_2)","line":7,"loc":{"start":{"line":7,"column":12},"end":{"line":7,"column":36}}},"3":{"name":"(anonymous_3)","line":17,"loc":{"start":{"line":17,"column":15},"end":{"line":17,"column":34}}},"4":{"name":"(anonymous_4)","line":18,"loc":{"start":{"line":18,"column":58},"end":{"line":18,"column":80}}},"5":{"name":"(anonymous_5)","line":29,"loc":{"start":{"line":29,"column":22},"end":{"line":29,"column":41}}},"6":{"name":"(anonymous_6)","line":30,"loc":{"start":{"line":30,"column":41},"end":{"line":30,"column":70}}},"7":{"name":"(anonymous_7)","line":40,"loc":{"start":{"line":40,"column":19},"end":{"line":40,"column":38}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":48}},"3":{"start":{"line":5,"column":0},"end":{"line":43,"column":1}},"4":{"start":{"line":7,"column":2},"end":{"line":14,"column":4}},"5":{"start":{"line":8,"column":3},"end":{"line":13,"column":4}},"6":{"start":{"line":9,"column":4},"end":{"line":9,"column":74}},"7":{"start":{"line":10,"column":4},"end":{"line":10,"column":21}},"8":{"start":{"line":12,"column":4},"end":{"line":12,"column":20}},"9":{"start":{"line":18,"column":2},"end":{"line":26,"column":4}},"10":{"start":{"line":19,"column":3},"end":{"line":24,"column":4}},"11":{"start":{"line":20,"column":4},"end":{"line":20,"column":40}},"12":{"start":{"line":21,"column":4},"end":{"line":21,"column":21}},"13":{"start":{"line":23,"column":4},"end":{"line":23,"column":18}},"14":{"start":{"line":30,"column":3},"end":{"line":37,"column":4}},"15":{"start":{"line":31,"column":3},"end":{"line":36,"column":4}},"16":{"start":{"line":32,"column":4},"end":{"line":32,"column":61}},"17":{"start":{"line":33,"column":4},"end":{"line":33,"column":21}},"18":{"start":{"line":35,"column":5},"end":{"line":35,"column":26}},"19":{"start":{"line":45,"column":0},"end":{"line":45,"column":33}}},"branchMap":{"1":{"line":8,"type":"if","locations":[{"start":{"line":8,"column":3},"end":{"line":8,"column":3}},{"start":{"line":8,"column":3},"end":{"line":8,"column":3}}]},"2":{"line":19,"type":"if","locations":[{"start":{"line":19,"column":3},"end":{"line":19,"column":3}},{"start":{"line":19,"column":3},"end":{"line":19,"column":3}}]},"3":{"line":31,"type":"if","locations":[{"start":{"line":31,"column":3},"end":{"line":31,"column":3}},{"start":{"line":31,"column":3},"end":{"line":31,"column":3}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/movies_model.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/movies_model.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":1,"7":0,"8":0,"9":0,"10":0,"11":0,"12":1,"13":0,"14":0,"15":0,"16":0,"17":1,"18":0,"19":0,"20":0,"21":0,"22":0,"23":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0},"fnMap":{"1":{"name":"(anonymous_1)","line":4,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":39}}},"2":{"name":"(anonymous_2)","line":9,"loc":{"start":{"line":9,"column":12},"end":{"line":9,"column":31}}},"3":{"name":"(anonymous_3)","line":10,"loc":{"start":{"line":10,"column":17},"end":{"line":10,"column":41}}},"4":{"name":"(anonymous_4)","line":14,"loc":{"start":{"line":14,"column":32},"end":{"line":14,"column":48}}},"5":{"name":"(anonymous_5)","line":21,"loc":{"start":{"line":21,"column":18},"end":{"line":21,"column":44}}},"6":{"name":"(anonymous_6)","line":22,"loc":{"start":{"line":22,"column":36},"end":{"line":22,"column":59}}},"7":{"name":"(anonymous_7)","line":33,"loc":{"start":{"line":33,"column":13},"end":{"line":33,"column":46}}},"8":{"name":"(anonymous_8)","line":39,"loc":{"start":{"line":39,"column":5},"end":{"line":39,"column":29}}},"9":{"name":"(anonymous_9)","line":43,"loc":{"start":{"line":43,"column":33},"end":{"line":43,"column":50}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}},"3":{"start":{"line":4,"column":0},"end":{"line":7,"column":1}},"4":{"start":{"line":5,"column":2},"end":{"line":5,"column":21}},"5":{"start":{"line":6,"column":2},"end":{"line":6,"column":29}},"6":{"start":{"line":9,"column":0},"end":{"line":19,"column":2}},"7":{"start":{"line":10,"column":2},"end":{"line":18,"column":4}},"8":{"start":{"line":11,"column":4},"end":{"line":17,"column":5}},"9":{"start":{"line":12,"column":6},"end":{"line":12,"column":75}},"10":{"start":{"line":14,"column":6},"end":{"line":16,"column":9}},"11":{"start":{"line":15,"column":8},"end":{"line":15,"column":38}},"12":{"start":{"line":21,"column":0},"end":{"line":31,"column":2}},"13":{"start":{"line":22,"column":2},"end":{"line":30,"column":4}},"14":{"start":{"line":24,"column":4},"end":{"line":29,"column":5}},"15":{"start":{"line":26,"column":6},"end":{"line":26,"column":65}},"16":{"start":{"line":28,"column":6},"end":{"line":28,"column":27}},"17":{"start":{"line":33,"column":0},"end":{"line":48,"column":1}},"18":{"start":{"line":35,"column":1},"end":{"line":47,"column":4}},"19":{"start":{"line":40,"column":4},"end":{"line":46,"column":5}},"20":{"start":{"line":41,"column":6},"end":{"line":41,"column":74}},"21":{"start":{"line":43,"column":6},"end":{"line":45,"column":9}},"22":{"start":{"line":44,"column":8},"end":{"line":44,"column":20}},"23":{"start":{"line":50,"column":0},"end":{"line":50,"column":23}}},"branchMap":{"1":{"line":11,"type":"if","locations":[{"start":{"line":11,"column":4},"end":{"line":11,"column":4}},{"start":{"line":11,"column":4},"end":{"line":11,"column":4}}]},"2":{"line":11,"type":"binary-expr","locations":[{"start":{"line":11,"column":8},"end":{"line":11,"column":13}},{"start":{"line":11,"column":16},"end":{"line":11,"column":23}}]},"3":{"line":12,"type":"binary-expr","locations":[{"start":{"line":12,"column":15},"end":{"line":12,"column":20}},{"start":{"line":12,"column":24},"end":{"line":12,"column":62}}]},"4":{"line":24,"type":"if","locations":[{"start":{"line":24,"column":4},"end":{"line":24,"column":4}},{"start":{"line":24,"column":4},"end":{"line":24,"column":4}}]},"5":{"line":24,"type":"binary-expr","locations":[{"start":{"line":24,"column":8},"end":{"line":24,"column":13}},{"start":{"line":24,"column":17},"end":{"line":24,"column":23}}]},"6":{"line":26,"type":"binary-expr","locations":[{"start":{"line":26,"column":15},"end":{"line":26,"column":20}},{"start":{"line":26,"column":24},"end":{"line":26,"column":52}}]},"7":{"line":40,"type":"if","locations":[{"start":{"line":40,"column":4},"end":{"line":40,"column":4}},{"start":{"line":40,"column":4},"end":{"line":40,"column":4}}]},"8":{"line":40,"type":"binary-expr","locations":[{"start":{"line":40,"column":8},"end":{"line":40,"column":13}},{"start":{"line":40,"column":17},"end":{"line":40,"column":24}}]},"9":{"line":41,"type":"binary-expr","locations":[{"start":{"line":41,"column":15},"end":{"line":41,"column":20}},{"start":{"line":41,"column":24},"end":{"line":41,"column":62}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/rentals.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/rentals.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1},"b":{},"f":{},"fnMap":{},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}},"3":{"start":{"line":3,"column":0},"end":{"line":3,"column":50}},"4":{"start":{"line":5,"column":0},"end":{"line":5,"column":52}},"5":{"start":{"line":6,"column":0},"end":{"line":6,"column":44}},"6":{"start":{"line":7,"column":0},"end":{"line":7,"column":63}},"7":{"start":{"line":9,"column":0},"end":{"line":9,"column":74}},"8":{"start":{"line":12,"column":0},"end":{"line":12,"column":54}},"9":{"start":{"line":17,"column":0},"end":{"line":17,"column":24}}},"branchMap":{}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/rentals.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/rentals.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0},"fnMap":{"1":{"name":"(anonymous_1)","line":5,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":32}}},"2":{"name":"(anonymous_2)","line":6,"loc":{"start":{"line":6,"column":36},"end":{"line":6,"column":59}}},"3":{"name":"(anonymous_3)","line":11,"loc":{"start":{"line":11,"column":41},"end":{"line":11,"column":70}}},"4":{"name":"(anonymous_4)","line":26,"loc":{"start":{"line":26,"column":22},"end":{"line":26,"column":41}}},"5":{"name":"(anonymous_5)","line":27,"loc":{"start":{"line":27,"column":41},"end":{"line":27,"column":70}}},"6":{"name":"(anonymous_6)","line":37,"loc":{"start":{"line":37,"column":21},"end":{"line":37,"column":46}}},"7":{"name":"(anonymous_7)","line":38,"loc":{"start":{"line":38,"column":62},"end":{"line":38,"column":91}}},"8":{"name":"(anonymous_8)","line":48,"loc":{"start":{"line":48,"column":19},"end":{"line":48,"column":38}}},"9":{"name":"(anonymous_9)","line":49,"loc":{"start":{"line":49,"column":34},"end":{"line":49,"column":60}}},"10":{"name":"(anonymous_10)","line":60,"loc":{"start":{"line":60,"column":20},"end":{"line":60,"column":39}}},"11":{"name":"(anonymous_11)","line":61,"loc":{"start":{"line":61,"column":20},"end":{"line":61,"column":46}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":46}},"3":{"start":{"line":4,"column":0},"end":{"line":70,"column":1}},"4":{"start":{"line":6,"column":2},"end":{"line":23,"column":4}},"5":{"start":{"line":7,"column":3},"end":{"line":21,"column":4}},"6":{"start":{"line":8,"column":4},"end":{"line":8,"column":41}},"7":{"start":{"line":9,"column":4},"end":{"line":9,"column":21}},"8":{"start":{"line":11,"column":4},"end":{"line":20,"column":6}},"9":{"start":{"line":12,"column":5},"end":{"line":18,"column":6}},"10":{"start":{"line":19,"column":5},"end":{"line":19,"column":26}},"11":{"start":{"line":27,"column":3},"end":{"line":34,"column":4}},"12":{"start":{"line":28,"column":3},"end":{"line":33,"column":4}},"13":{"start":{"line":29,"column":4},"end":{"line":29,"column":61}},"14":{"start":{"line":30,"column":4},"end":{"line":30,"column":21}},"15":{"start":{"line":32,"column":5},"end":{"line":32,"column":26}},"16":{"start":{"line":38,"column":2},"end":{"line":45,"column":5}},"17":{"start":{"line":39,"column":3},"end":{"line":44,"column":4}},"18":{"start":{"line":40,"column":4},"end":{"line":40,"column":61}},"19":{"start":{"line":41,"column":4},"end":{"line":41,"column":21}},"20":{"start":{"line":43,"column":4},"end":{"line":43,"column":25}},"21":{"start":{"line":49,"column":2},"end":{"line":56,"column":5}},"22":{"start":{"line":50,"column":3},"end":{"line":55,"column":4}},"23":{"start":{"line":51,"column":4},"end":{"line":51,"column":61}},"24":{"start":{"line":52,"column":4},"end":{"line":52,"column":21}},"25":{"start":{"line":54,"column":4},"end":{"line":54,"column":22}},"26":{"start":{"line":61,"column":2},"end":{"line":68,"column":5}},"27":{"start":{"line":62,"column":3},"end":{"line":67,"column":4}},"28":{"start":{"line":63,"column":4},"end":{"line":63,"column":33}},"29":{"start":{"line":64,"column":4},"end":{"line":64,"column":21}},"30":{"start":{"line":66,"column":4},"end":{"line":66,"column":22}},"31":{"start":{"line":72,"column":0},"end":{"line":72,"column":34}}},"branchMap":{"1":{"line":7,"type":"if","locations":[{"start":{"line":7,"column":3},"end":{"line":7,"column":3}},{"start":{"line":7,"column":3},"end":{"line":7,"column":3}}]},"2":{"line":28,"type":"if","locations":[{"start":{"line":28,"column":3},"end":{"line":28,"column":3}},{"start":{"line":28,"column":3},"end":{"line":28,"column":3}}]},"3":{"line":39,"type":"if","locations":[{"start":{"line":39,"column":3},"end":{"line":39,"column":3}},{"start":{"line":39,"column":3},"end":{"line":39,"column":3}}]},"4":{"line":50,"type":"if","locations":[{"start":{"line":50,"column":3},"end":{"line":50,"column":3}},{"start":{"line":50,"column":3},"end":{"line":50,"column":3}}]},"5":{"line":62,"type":"if","locations":[{"start":{"line":62,"column":3},"end":{"line":62,"column":3}},{"start":{"line":62,"column":3},"end":{"line":62,"column":3}}]}}}} \ No newline at end of file +{"/Users/leahpetersen/C5/projects/VideoStoreAPI/app.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/app.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":1,"19":1,"20":1,"21":1,"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":0,"29":0,"30":0,"31":1,"32":0,"33":0,"34":0,"35":1,"36":0,"37":0,"38":1},"b":{"1":[0,1],"2":[0,0],"3":[0,0]},"f":{"1":0,"2":0,"3":0},"fnMap":{"1":{"name":"(anonymous_1)","line":50,"loc":{"start":{"line":50,"column":8},"end":{"line":50,"column":33}}},"2":{"name":"(anonymous_2)","line":61,"loc":{"start":{"line":61,"column":10},"end":{"line":61,"column":40}}},"3":{"name":"(anonymous_3)","line":72,"loc":{"start":{"line":72,"column":8},"end":{"line":72,"column":38}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":27}},"3":{"start":{"line":3,"column":0},"end":{"line":3,"column":39}},"4":{"start":{"line":4,"column":0},"end":{"line":4,"column":31}},"5":{"start":{"line":5,"column":0},"end":{"line":5,"column":44}},"6":{"start":{"line":6,"column":0},"end":{"line":6,"column":40}},"7":{"start":{"line":7,"column":0},"end":{"line":7,"column":33}},"8":{"start":{"line":8,"column":0},"end":{"line":8,"column":37}},"9":{"start":{"line":11,"column":0},"end":{"line":11,"column":76}},"10":{"start":{"line":16,"column":0},"end":{"line":16,"column":80}},"11":{"start":{"line":19,"column":0},"end":{"line":19,"column":31}},"12":{"start":{"line":23,"column":0},"end":{"line":23,"column":48}},"13":{"start":{"line":24,"column":0},"end":{"line":24,"column":31}},"14":{"start":{"line":28,"column":0},"end":{"line":28,"column":23}},"15":{"start":{"line":31,"column":0},"end":{"line":31,"column":27}},"16":{"start":{"line":32,"column":0},"end":{"line":32,"column":52}},"17":{"start":{"line":33,"column":0},"end":{"line":33,"column":24}},"18":{"start":{"line":34,"column":0},"end":{"line":34,"column":56}},"19":{"start":{"line":36,"column":0},"end":{"line":36,"column":42}},"20":{"start":{"line":37,"column":0},"end":{"line":37,"column":46}},"21":{"start":{"line":38,"column":0},"end":{"line":38,"column":43}},"22":{"start":{"line":39,"column":0},"end":{"line":39,"column":44}},"23":{"start":{"line":43,"column":0},"end":{"line":43,"column":21}},"24":{"start":{"line":44,"column":0},"end":{"line":44,"column":33}},"25":{"start":{"line":45,"column":0},"end":{"line":45,"column":27}},"26":{"start":{"line":46,"column":0},"end":{"line":46,"column":29}},"27":{"start":{"line":50,"column":0},"end":{"line":54,"column":3}},"28":{"start":{"line":51,"column":2},"end":{"line":51,"column":35}},"29":{"start":{"line":52,"column":2},"end":{"line":52,"column":19}},"30":{"start":{"line":53,"column":2},"end":{"line":53,"column":12}},"31":{"start":{"line":60,"column":0},"end":{"line":68,"column":1}},"32":{"start":{"line":61,"column":2},"end":{"line":67,"column":5}},"33":{"start":{"line":62,"column":4},"end":{"line":62,"column":34}},"34":{"start":{"line":63,"column":4},"end":{"line":66,"column":7}},"35":{"start":{"line":72,"column":0},"end":{"line":78,"column":3}},"36":{"start":{"line":73,"column":2},"end":{"line":73,"column":32}},"37":{"start":{"line":74,"column":2},"end":{"line":77,"column":5}},"38":{"start":{"line":81,"column":0},"end":{"line":81,"column":21}}},"branchMap":{"1":{"line":60,"type":"if","locations":[{"start":{"line":60,"column":0},"end":{"line":60,"column":0}},{"start":{"line":60,"column":0},"end":{"line":60,"column":0}}]},"2":{"line":62,"type":"binary-expr","locations":[{"start":{"line":62,"column":15},"end":{"line":62,"column":25}},{"start":{"line":62,"column":29},"end":{"line":62,"column":32}}]},"3":{"line":73,"type":"binary-expr","locations":[{"start":{"line":73,"column":13},"end":{"line":73,"column":23}},{"start":{"line":73,"column":27},"end":{"line":73,"column":30}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/index.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/index.js","s":{"1":1,"2":1,"3":1,"4":0,"5":1,"6":0,"7":1},"b":{},"f":{"1":0,"2":0},"fnMap":{"1":{"name":"(anonymous_1)","line":6,"loc":{"start":{"line":6,"column":16},"end":{"line":6,"column":41}}},"2":{"name":"(anonymous_2)","line":10,"loc":{"start":{"line":10,"column":20},"end":{"line":10,"column":45}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}},"3":{"start":{"line":6,"column":0},"end":{"line":8,"column":3}},"4":{"start":{"line":7,"column":2},"end":{"line":7,"column":40}},"5":{"start":{"line":10,"column":0},"end":{"line":12,"column":3}},"6":{"start":{"line":11,"column":2},"end":{"line":11,"column":49}},"7":{"start":{"line":14,"column":0},"end":{"line":14,"column":24}}},"branchMap":{}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/customers.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/customers.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1},"b":{},"f":{},"fnMap":{},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}},"3":{"start":{"line":3,"column":0},"end":{"line":3,"column":52}},"4":{"start":{"line":6,"column":0},"end":{"line":6,"column":40}},"5":{"start":{"line":7,"column":0},"end":{"line":7,"column":55}},"6":{"start":{"line":8,"column":0},"end":{"line":8,"column":67}},"7":{"start":{"line":9,"column":0},"end":{"line":9,"column":67}},"8":{"start":{"line":12,"column":0},"end":{"line":12,"column":24}}},"branchMap":{}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/customers.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/customers.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0},"fnMap":{"1":{"name":"(anonymous_1)","line":6,"loc":{"start":{"line":6,"column":15},"end":{"line":6,"column":34}}},"2":{"name":"(anonymous_2)","line":7,"loc":{"start":{"line":7,"column":15},"end":{"line":7,"column":42}}},"3":{"name":"(anonymous_3)","line":17,"loc":{"start":{"line":17,"column":18},"end":{"line":17,"column":37}}},"4":{"name":"(anonymous_4)","line":18,"loc":{"start":{"line":18,"column":61},"end":{"line":18,"column":83}}},"5":{"name":"(anonymous_5)","line":29,"loc":{"start":{"line":29,"column":22},"end":{"line":29,"column":41}}},"6":{"name":"(anonymous_6)","line":30,"loc":{"start":{"line":30,"column":51},"end":{"line":30,"column":73}}},"7":{"name":"(anonymous_7)","line":40,"loc":{"start":{"line":40,"column":22},"end":{"line":40,"column":41}}},"8":{"name":"(anonymous_8)","line":41,"loc":{"start":{"line":41,"column":48},"end":{"line":41,"column":70}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":48}},"3":{"start":{"line":5,"column":0},"end":{"line":50,"column":1}},"4":{"start":{"line":7,"column":2},"end":{"line":14,"column":4}},"5":{"start":{"line":8,"column":3},"end":{"line":13,"column":4}},"6":{"start":{"line":9,"column":4},"end":{"line":9,"column":76}},"7":{"start":{"line":10,"column":4},"end":{"line":10,"column":21}},"8":{"start":{"line":12,"column":4},"end":{"line":12,"column":23}},"9":{"start":{"line":18,"column":2},"end":{"line":25,"column":4}},"10":{"start":{"line":19,"column":3},"end":{"line":24,"column":4}},"11":{"start":{"line":20,"column":4},"end":{"line":20,"column":40}},"12":{"start":{"line":21,"column":4},"end":{"line":21,"column":21}},"13":{"start":{"line":23,"column":4},"end":{"line":23,"column":18}},"14":{"start":{"line":30,"column":2},"end":{"line":37,"column":4}},"15":{"start":{"line":31,"column":3},"end":{"line":36,"column":4}},"16":{"start":{"line":32,"column":4},"end":{"line":32,"column":40}},"17":{"start":{"line":33,"column":4},"end":{"line":33,"column":21}},"18":{"start":{"line":35,"column":4},"end":{"line":35,"column":18}},"19":{"start":{"line":41,"column":2},"end":{"line":48,"column":4}},"20":{"start":{"line":42,"column":3},"end":{"line":47,"column":4}},"21":{"start":{"line":43,"column":4},"end":{"line":43,"column":40}},"22":{"start":{"line":44,"column":4},"end":{"line":44,"column":21}},"23":{"start":{"line":46,"column":4},"end":{"line":46,"column":18}},"24":{"start":{"line":51,"column":0},"end":{"line":51,"column":36}}},"branchMap":{"1":{"line":8,"type":"if","locations":[{"start":{"line":8,"column":3},"end":{"line":8,"column":3}},{"start":{"line":8,"column":3},"end":{"line":8,"column":3}}]},"2":{"line":19,"type":"if","locations":[{"start":{"line":19,"column":3},"end":{"line":19,"column":3}},{"start":{"line":19,"column":3},"end":{"line":19,"column":3}}]},"3":{"line":31,"type":"if","locations":[{"start":{"line":31,"column":3},"end":{"line":31,"column":3}},{"start":{"line":31,"column":3},"end":{"line":31,"column":3}}]},"4":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":3},"end":{"line":42,"column":3}},{"start":{"line":42,"column":3},"end":{"line":42,"column":3}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/customers_model.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/customers_model.js","s":{"1":1,"2":1,"3":1,"4":200,"5":1,"6":1,"7":1,"8":0,"9":1,"10":200,"11":1,"12":1,"13":1,"14":0,"15":1,"16":2,"17":1},"b":{"1":[0,1],"2":[1,1],"3":[0,0],"4":[0,1],"5":[1,1],"6":[0,0]},"f":{"1":200,"2":1,"3":1,"4":200,"5":1,"6":1,"7":2},"fnMap":{"1":{"name":"(anonymous_1)","line":4,"loc":{"start":{"line":4,"column":15},"end":{"line":4,"column":28}}},"2":{"name":"(anonymous_2)","line":8,"loc":{"start":{"line":8,"column":15},"end":{"line":8,"column":34}}},"3":{"name":"(anonymous_3)","line":9,"loc":{"start":{"line":9,"column":20},"end":{"line":9,"column":47}}},"4":{"name":"(anonymous_4)","line":13,"loc":{"start":{"line":13,"column":35},"end":{"line":13,"column":54}}},"5":{"name":"(anonymous_5)","line":20,"loc":{"start":{"line":20,"column":16},"end":{"line":20,"column":49}}},"6":{"name":"(anonymous_6)","line":26,"loc":{"start":{"line":26,"column":5},"end":{"line":26,"column":32}}},"7":{"name":"(anonymous_7)","line":30,"loc":{"start":{"line":30,"column":36},"end":{"line":30,"column":56}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}},"3":{"start":{"line":4,"column":0},"end":{"line":6,"column":1}},"4":{"start":{"line":5,"column":2},"end":{"line":5,"column":15}},"5":{"start":{"line":8,"column":0},"end":{"line":18,"column":2}},"6":{"start":{"line":9,"column":2},"end":{"line":17,"column":4}},"7":{"start":{"line":10,"column":4},"end":{"line":16,"column":5}},"8":{"start":{"line":11,"column":6},"end":{"line":11,"column":78}},"9":{"start":{"line":13,"column":6},"end":{"line":15,"column":9}},"10":{"start":{"line":14,"column":8},"end":{"line":14,"column":41}},"11":{"start":{"line":20,"column":0},"end":{"line":35,"column":1}},"12":{"start":{"line":22,"column":1},"end":{"line":34,"column":4}},"13":{"start":{"line":27,"column":4},"end":{"line":33,"column":5}},"14":{"start":{"line":28,"column":6},"end":{"line":28,"column":77}},"15":{"start":{"line":30,"column":6},"end":{"line":32,"column":9}},"16":{"start":{"line":31,"column":8},"end":{"line":31,"column":23}},"17":{"start":{"line":37,"column":0},"end":{"line":37,"column":26}}},"branchMap":{"1":{"line":10,"type":"if","locations":[{"start":{"line":10,"column":4},"end":{"line":10,"column":4}},{"start":{"line":10,"column":4},"end":{"line":10,"column":4}}]},"2":{"line":10,"type":"binary-expr","locations":[{"start":{"line":10,"column":8},"end":{"line":10,"column":13}},{"start":{"line":10,"column":16},"end":{"line":10,"column":26}}]},"3":{"line":11,"type":"binary-expr","locations":[{"start":{"line":11,"column":15},"end":{"line":11,"column":20}},{"start":{"line":11,"column":24},"end":{"line":11,"column":65}}]},"4":{"line":27,"type":"if","locations":[{"start":{"line":27,"column":4},"end":{"line":27,"column":4}},{"start":{"line":27,"column":4},"end":{"line":27,"column":4}}]},"5":{"line":27,"type":"binary-expr","locations":[{"start":{"line":27,"column":8},"end":{"line":27,"column":13}},{"start":{"line":27,"column":17},"end":{"line":27,"column":27}}]},"6":{"line":28,"type":"binary-expr","locations":[{"start":{"line":28,"column":15},"end":{"line":28,"column":20}},{"start":{"line":28,"column":24},"end":{"line":28,"column":65}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/rentals_model.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/rentals_model.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":1,"11":0,"12":0,"13":0,"14":0,"15":1,"16":0,"17":0,"18":0,"19":0,"20":1,"21":0,"22":0,"23":0,"24":0,"25":1,"26":0,"27":0,"28":0,"29":0,"30":1,"31":0,"32":0,"33":0,"34":0,"35":1,"36":0,"37":0,"38":0,"39":0,"40":0,"41":1,"42":0,"43":0,"44":0,"45":0,"46":1,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0},"fnMap":{"1":{"name":"(anonymous_1)","line":4,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":109}}},"2":{"name":"(anonymous_2)","line":14,"loc":{"start":{"line":14,"column":23},"end":{"line":14,"column":49}}},"3":{"name":"(anonymous_3)","line":15,"loc":{"start":{"line":15,"column":63},"end":{"line":15,"column":92}}},"4":{"name":"(anonymous_4)","line":24,"loc":{"start":{"line":24,"column":27},"end":{"line":24,"column":59}}},"5":{"name":"(anonymous_5)","line":25,"loc":{"start":{"line":25,"column":75},"end":{"line":25,"column":104}}},"6":{"name":"(anonymous_6)","line":34,"loc":{"start":{"line":34,"column":32},"end":{"line":34,"column":58}}},"7":{"name":"(anonymous_7)","line":35,"loc":{"start":{"line":35,"column":58},"end":{"line":35,"column":82}}},"8":{"name":"(anonymous_8)","line":44,"loc":{"start":{"line":44,"column":24},"end":{"line":44,"column":56}}},"9":{"name":"(anonymous_9)","line":45,"loc":{"start":{"line":45,"column":168},"end":{"line":45,"column":198}}},"10":{"name":"(anonymous_10)","line":54,"loc":{"start":{"line":54,"column":22},"end":{"line":54,"column":54}}},"11":{"name":"(anonymous_11)","line":55,"loc":{"start":{"line":55,"column":167},"end":{"line":55,"column":194}}},"12":{"name":"(anonymous_12)","line":64,"loc":{"start":{"line":64,"column":20},"end":{"line":64,"column":39}}},"13":{"name":"(anonymous_13)","line":66,"loc":{"start":{"line":66,"column":266},"end":{"line":66,"column":293}}},"14":{"name":"(anonymous_14)","line":74,"loc":{"start":{"line":74,"column":19},"end":{"line":74,"column":49}}},"15":{"name":"(anonymous_15)","line":79,"loc":{"start":{"line":79,"column":7},"end":{"line":79,"column":36}}},"16":{"name":"(anonymous_16)","line":88,"loc":{"start":{"line":88,"column":21},"end":{"line":88,"column":57}}},"17":{"name":"(anonymous_17)","line":93,"loc":{"start":{"line":93,"column":5},"end":{"line":93,"column":29}}},"18":{"name":"(anonymous_18)","line":101,"loc":{"start":{"line":101,"column":90},"end":{"line":101,"column":149}}},"19":{"name":"(anonymous_19)","line":119,"loc":{"start":{"line":119,"column":9},"end":{"line":119,"column":34}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}},"3":{"start":{"line":4,"column":0},"end":{"line":12,"column":2}},"4":{"start":{"line":5,"column":2},"end":{"line":5,"column":27}},"5":{"start":{"line":6,"column":2},"end":{"line":6,"column":33}},"6":{"start":{"line":7,"column":2},"end":{"line":7,"column":35}},"7":{"start":{"line":8,"column":2},"end":{"line":8,"column":27}},"8":{"start":{"line":9,"column":2},"end":{"line":9,"column":27}},"9":{"start":{"line":10,"column":2},"end":{"line":10,"column":37}},"10":{"start":{"line":14,"column":0},"end":{"line":22,"column":1}},"11":{"start":{"line":15,"column":2},"end":{"line":21,"column":4}},"12":{"start":{"line":16,"column":4},"end":{"line":20,"column":5}},"13":{"start":{"line":17,"column":6},"end":{"line":17,"column":33}},"14":{"start":{"line":19,"column":6},"end":{"line":19,"column":34}},"15":{"start":{"line":24,"column":0},"end":{"line":32,"column":1}},"16":{"start":{"line":25,"column":2},"end":{"line":31,"column":4}},"17":{"start":{"line":26,"column":4},"end":{"line":30,"column":5}},"18":{"start":{"line":27,"column":6},"end":{"line":27,"column":33}},"19":{"start":{"line":29,"column":6},"end":{"line":29,"column":34}},"20":{"start":{"line":34,"column":0},"end":{"line":42,"column":1}},"21":{"start":{"line":35,"column":2},"end":{"line":41,"column":4}},"22":{"start":{"line":36,"column":4},"end":{"line":40,"column":5}},"23":{"start":{"line":37,"column":6},"end":{"line":37,"column":22}},"24":{"start":{"line":39,"column":6},"end":{"line":39,"column":28}},"25":{"start":{"line":44,"column":0},"end":{"line":52,"column":1}},"26":{"start":{"line":45,"column":2},"end":{"line":51,"column":4}},"27":{"start":{"line":46,"column":4},"end":{"line":50,"column":5}},"28":{"start":{"line":47,"column":6},"end":{"line":47,"column":33}},"29":{"start":{"line":49,"column":6},"end":{"line":49,"column":35}},"30":{"start":{"line":54,"column":0},"end":{"line":62,"column":1}},"31":{"start":{"line":55,"column":2},"end":{"line":61,"column":4}},"32":{"start":{"line":56,"column":4},"end":{"line":60,"column":5}},"33":{"start":{"line":57,"column":6},"end":{"line":57,"column":33}},"34":{"start":{"line":59,"column":6},"end":{"line":59,"column":32}},"35":{"start":{"line":64,"column":0},"end":{"line":72,"column":1}},"36":{"start":{"line":65,"column":2},"end":{"line":65,"column":22}},"37":{"start":{"line":66,"column":2},"end":{"line":71,"column":7}},"38":{"start":{"line":67,"column":4},"end":{"line":69,"column":5}},"39":{"start":{"line":68,"column":6},"end":{"line":68,"column":33}},"40":{"start":{"line":70,"column":4},"end":{"line":70,"column":29}},"41":{"start":{"line":74,"column":0},"end":{"line":86,"column":1}},"42":{"start":{"line":75,"column":2},"end":{"line":85,"column":4}},"43":{"start":{"line":80,"column":4},"end":{"line":84,"column":5}},"44":{"start":{"line":81,"column":6},"end":{"line":81,"column":33}},"45":{"start":{"line":83,"column":6},"end":{"line":83,"column":34}},"46":{"start":{"line":88,"column":0},"end":{"line":128,"column":1}},"47":{"start":{"line":90,"column":2},"end":{"line":127,"column":5}},"48":{"start":{"line":94,"column":4},"end":{"line":98,"column":5}},"49":{"start":{"line":95,"column":6},"end":{"line":95,"column":29}},"50":{"start":{"line":96,"column":11},"end":{"line":98,"column":5}},"51":{"start":{"line":97,"column":6},"end":{"line":97,"column":52}},"52":{"start":{"line":101,"column":6},"end":{"line":126,"column":7}},"53":{"start":{"line":102,"column":8},"end":{"line":104,"column":9}},"54":{"start":{"line":103,"column":10},"end":{"line":103,"column":33}},"55":{"start":{"line":107,"column":6},"end":{"line":107,"column":27}},"56":{"start":{"line":108,"column":6},"end":{"line":108,"column":30}},"57":{"start":{"line":109,"column":6},"end":{"line":109,"column":37}},"58":{"start":{"line":112,"column":6},"end":{"line":125,"column":9}},"59":{"start":{"line":120,"column":8},"end":{"line":122,"column":9}},"60":{"start":{"line":121,"column":10},"end":{"line":121,"column":33}},"61":{"start":{"line":124,"column":8},"end":{"line":124,"column":38}},"62":{"start":{"line":130,"column":0},"end":{"line":130,"column":24}}},"branchMap":{"1":{"line":16,"type":"if","locations":[{"start":{"line":16,"column":4},"end":{"line":16,"column":4}},{"start":{"line":16,"column":4},"end":{"line":16,"column":4}}]},"2":{"line":26,"type":"if","locations":[{"start":{"line":26,"column":4},"end":{"line":26,"column":4}},{"start":{"line":26,"column":4},"end":{"line":26,"column":4}}]},"3":{"line":36,"type":"if","locations":[{"start":{"line":36,"column":4},"end":{"line":36,"column":4}},{"start":{"line":36,"column":4},"end":{"line":36,"column":4}}]},"4":{"line":46,"type":"if","locations":[{"start":{"line":46,"column":4},"end":{"line":46,"column":4}},{"start":{"line":46,"column":4},"end":{"line":46,"column":4}}]},"5":{"line":56,"type":"if","locations":[{"start":{"line":56,"column":4},"end":{"line":56,"column":4}},{"start":{"line":56,"column":4},"end":{"line":56,"column":4}}]},"6":{"line":67,"type":"if","locations":[{"start":{"line":67,"column":4},"end":{"line":67,"column":4}},{"start":{"line":67,"column":4},"end":{"line":67,"column":4}}]},"7":{"line":80,"type":"if","locations":[{"start":{"line":80,"column":4},"end":{"line":80,"column":4}},{"start":{"line":80,"column":4},"end":{"line":80,"column":4}}]},"8":{"line":94,"type":"if","locations":[{"start":{"line":94,"column":4},"end":{"line":94,"column":4}},{"start":{"line":94,"column":4},"end":{"line":94,"column":4}}]},"9":{"line":96,"type":"if","locations":[{"start":{"line":96,"column":11},"end":{"line":96,"column":11}},{"start":{"line":96,"column":11},"end":{"line":96,"column":11}}]},"10":{"line":102,"type":"if","locations":[{"start":{"line":102,"column":8},"end":{"line":102,"column":8}},{"start":{"line":102,"column":8},"end":{"line":102,"column":8}}]},"11":{"line":120,"type":"if","locations":[{"start":{"line":120,"column":8},"end":{"line":120,"column":8}},{"start":{"line":120,"column":8},"end":{"line":120,"column":8}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/movies.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/movies.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1},"b":{},"f":{},"fnMap":{},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}},"3":{"start":{"line":3,"column":0},"end":{"line":3,"column":49}},"4":{"start":{"line":6,"column":0},"end":{"line":6,"column":37}},"5":{"start":{"line":7,"column":0},"end":{"line":7,"column":52}},"6":{"start":{"line":8,"column":0},"end":{"line":8,"column":61}},"7":{"start":{"line":9,"column":0},"end":{"line":9,"column":58}},"8":{"start":{"line":12,"column":0},"end":{"line":12,"column":24}}},"branchMap":{}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/movies.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/movies.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0},"fnMap":{"1":{"name":"(anonymous_1)","line":6,"loc":{"start":{"line":6,"column":12},"end":{"line":6,"column":31}}},"2":{"name":"(anonymous_2)","line":7,"loc":{"start":{"line":7,"column":12},"end":{"line":7,"column":36}}},"3":{"name":"(anonymous_3)","line":17,"loc":{"start":{"line":17,"column":15},"end":{"line":17,"column":34}}},"4":{"name":"(anonymous_4)","line":18,"loc":{"start":{"line":18,"column":58},"end":{"line":18,"column":80}}},"5":{"name":"(anonymous_5)","line":29,"loc":{"start":{"line":29,"column":22},"end":{"line":29,"column":41}}},"6":{"name":"(anonymous_6)","line":30,"loc":{"start":{"line":30,"column":41},"end":{"line":30,"column":70}}},"7":{"name":"(anonymous_7)","line":40,"loc":{"start":{"line":40,"column":19},"end":{"line":40,"column":38}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":48}},"3":{"start":{"line":5,"column":0},"end":{"line":43,"column":1}},"4":{"start":{"line":7,"column":2},"end":{"line":14,"column":4}},"5":{"start":{"line":8,"column":3},"end":{"line":13,"column":4}},"6":{"start":{"line":9,"column":4},"end":{"line":9,"column":74}},"7":{"start":{"line":10,"column":4},"end":{"line":10,"column":21}},"8":{"start":{"line":12,"column":4},"end":{"line":12,"column":20}},"9":{"start":{"line":18,"column":2},"end":{"line":26,"column":4}},"10":{"start":{"line":19,"column":3},"end":{"line":24,"column":4}},"11":{"start":{"line":20,"column":4},"end":{"line":20,"column":40}},"12":{"start":{"line":21,"column":4},"end":{"line":21,"column":21}},"13":{"start":{"line":23,"column":4},"end":{"line":23,"column":18}},"14":{"start":{"line":30,"column":3},"end":{"line":37,"column":4}},"15":{"start":{"line":31,"column":3},"end":{"line":36,"column":4}},"16":{"start":{"line":32,"column":4},"end":{"line":32,"column":61}},"17":{"start":{"line":33,"column":4},"end":{"line":33,"column":21}},"18":{"start":{"line":35,"column":5},"end":{"line":35,"column":26}},"19":{"start":{"line":45,"column":0},"end":{"line":45,"column":33}}},"branchMap":{"1":{"line":8,"type":"if","locations":[{"start":{"line":8,"column":3},"end":{"line":8,"column":3}},{"start":{"line":8,"column":3},"end":{"line":8,"column":3}}]},"2":{"line":19,"type":"if","locations":[{"start":{"line":19,"column":3},"end":{"line":19,"column":3}},{"start":{"line":19,"column":3},"end":{"line":19,"column":3}}]},"3":{"line":31,"type":"if","locations":[{"start":{"line":31,"column":3},"end":{"line":31,"column":3}},{"start":{"line":31,"column":3},"end":{"line":31,"column":3}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/movies_model.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/movies_model.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":1,"7":0,"8":0,"9":0,"10":0,"11":0,"12":1,"13":0,"14":0,"15":0,"16":0,"17":1,"18":0,"19":0,"20":0,"21":0,"22":0,"23":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0},"fnMap":{"1":{"name":"(anonymous_1)","line":4,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":39}}},"2":{"name":"(anonymous_2)","line":9,"loc":{"start":{"line":9,"column":12},"end":{"line":9,"column":31}}},"3":{"name":"(anonymous_3)","line":10,"loc":{"start":{"line":10,"column":17},"end":{"line":10,"column":41}}},"4":{"name":"(anonymous_4)","line":14,"loc":{"start":{"line":14,"column":32},"end":{"line":14,"column":48}}},"5":{"name":"(anonymous_5)","line":21,"loc":{"start":{"line":21,"column":18},"end":{"line":21,"column":44}}},"6":{"name":"(anonymous_6)","line":22,"loc":{"start":{"line":22,"column":36},"end":{"line":22,"column":59}}},"7":{"name":"(anonymous_7)","line":33,"loc":{"start":{"line":33,"column":13},"end":{"line":33,"column":46}}},"8":{"name":"(anonymous_8)","line":39,"loc":{"start":{"line":39,"column":5},"end":{"line":39,"column":29}}},"9":{"name":"(anonymous_9)","line":43,"loc":{"start":{"line":43,"column":33},"end":{"line":43,"column":50}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}},"3":{"start":{"line":4,"column":0},"end":{"line":7,"column":1}},"4":{"start":{"line":5,"column":2},"end":{"line":5,"column":21}},"5":{"start":{"line":6,"column":2},"end":{"line":6,"column":29}},"6":{"start":{"line":9,"column":0},"end":{"line":19,"column":2}},"7":{"start":{"line":10,"column":2},"end":{"line":18,"column":4}},"8":{"start":{"line":11,"column":4},"end":{"line":17,"column":5}},"9":{"start":{"line":12,"column":6},"end":{"line":12,"column":75}},"10":{"start":{"line":14,"column":6},"end":{"line":16,"column":9}},"11":{"start":{"line":15,"column":8},"end":{"line":15,"column":38}},"12":{"start":{"line":21,"column":0},"end":{"line":31,"column":2}},"13":{"start":{"line":22,"column":2},"end":{"line":30,"column":4}},"14":{"start":{"line":24,"column":4},"end":{"line":29,"column":5}},"15":{"start":{"line":26,"column":6},"end":{"line":26,"column":65}},"16":{"start":{"line":28,"column":6},"end":{"line":28,"column":27}},"17":{"start":{"line":33,"column":0},"end":{"line":48,"column":1}},"18":{"start":{"line":35,"column":1},"end":{"line":47,"column":4}},"19":{"start":{"line":40,"column":4},"end":{"line":46,"column":5}},"20":{"start":{"line":41,"column":6},"end":{"line":41,"column":74}},"21":{"start":{"line":43,"column":6},"end":{"line":45,"column":9}},"22":{"start":{"line":44,"column":8},"end":{"line":44,"column":20}},"23":{"start":{"line":50,"column":0},"end":{"line":50,"column":23}}},"branchMap":{"1":{"line":11,"type":"if","locations":[{"start":{"line":11,"column":4},"end":{"line":11,"column":4}},{"start":{"line":11,"column":4},"end":{"line":11,"column":4}}]},"2":{"line":11,"type":"binary-expr","locations":[{"start":{"line":11,"column":8},"end":{"line":11,"column":13}},{"start":{"line":11,"column":16},"end":{"line":11,"column":23}}]},"3":{"line":12,"type":"binary-expr","locations":[{"start":{"line":12,"column":15},"end":{"line":12,"column":20}},{"start":{"line":12,"column":24},"end":{"line":12,"column":62}}]},"4":{"line":24,"type":"if","locations":[{"start":{"line":24,"column":4},"end":{"line":24,"column":4}},{"start":{"line":24,"column":4},"end":{"line":24,"column":4}}]},"5":{"line":24,"type":"binary-expr","locations":[{"start":{"line":24,"column":8},"end":{"line":24,"column":13}},{"start":{"line":24,"column":17},"end":{"line":24,"column":23}}]},"6":{"line":26,"type":"binary-expr","locations":[{"start":{"line":26,"column":15},"end":{"line":26,"column":20}},{"start":{"line":26,"column":24},"end":{"line":26,"column":52}}]},"7":{"line":40,"type":"if","locations":[{"start":{"line":40,"column":4},"end":{"line":40,"column":4}},{"start":{"line":40,"column":4},"end":{"line":40,"column":4}}]},"8":{"line":40,"type":"binary-expr","locations":[{"start":{"line":40,"column":8},"end":{"line":40,"column":13}},{"start":{"line":40,"column":17},"end":{"line":40,"column":24}}]},"9":{"line":41,"type":"binary-expr","locations":[{"start":{"line":41,"column":15},"end":{"line":41,"column":20}},{"start":{"line":41,"column":24},"end":{"line":41,"column":62}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/rentals.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/rentals.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1},"b":{},"f":{},"fnMap":{},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}},"3":{"start":{"line":3,"column":0},"end":{"line":3,"column":50}},"4":{"start":{"line":5,"column":0},"end":{"line":5,"column":52}},"5":{"start":{"line":6,"column":0},"end":{"line":6,"column":44}},"6":{"start":{"line":7,"column":0},"end":{"line":7,"column":63}},"7":{"start":{"line":9,"column":0},"end":{"line":9,"column":74}},"8":{"start":{"line":12,"column":0},"end":{"line":12,"column":54}},"9":{"start":{"line":17,"column":0},"end":{"line":17,"column":24}}},"branchMap":{}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/rentals.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/rentals.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0},"fnMap":{"1":{"name":"(anonymous_1)","line":5,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":32}}},"2":{"name":"(anonymous_2)","line":6,"loc":{"start":{"line":6,"column":36},"end":{"line":6,"column":59}}},"3":{"name":"(anonymous_3)","line":11,"loc":{"start":{"line":11,"column":41},"end":{"line":11,"column":70}}},"4":{"name":"(anonymous_4)","line":26,"loc":{"start":{"line":26,"column":22},"end":{"line":26,"column":41}}},"5":{"name":"(anonymous_5)","line":27,"loc":{"start":{"line":27,"column":41},"end":{"line":27,"column":70}}},"6":{"name":"(anonymous_6)","line":37,"loc":{"start":{"line":37,"column":21},"end":{"line":37,"column":46}}},"7":{"name":"(anonymous_7)","line":38,"loc":{"start":{"line":38,"column":62},"end":{"line":38,"column":91}}},"8":{"name":"(anonymous_8)","line":48,"loc":{"start":{"line":48,"column":19},"end":{"line":48,"column":38}}},"9":{"name":"(anonymous_9)","line":49,"loc":{"start":{"line":49,"column":34},"end":{"line":49,"column":60}}},"10":{"name":"(anonymous_10)","line":60,"loc":{"start":{"line":60,"column":20},"end":{"line":60,"column":39}}},"11":{"name":"(anonymous_11)","line":61,"loc":{"start":{"line":61,"column":20},"end":{"line":61,"column":46}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":46}},"3":{"start":{"line":4,"column":0},"end":{"line":70,"column":1}},"4":{"start":{"line":6,"column":2},"end":{"line":23,"column":4}},"5":{"start":{"line":7,"column":3},"end":{"line":21,"column":4}},"6":{"start":{"line":8,"column":4},"end":{"line":8,"column":41}},"7":{"start":{"line":9,"column":4},"end":{"line":9,"column":21}},"8":{"start":{"line":11,"column":4},"end":{"line":20,"column":6}},"9":{"start":{"line":12,"column":5},"end":{"line":18,"column":6}},"10":{"start":{"line":19,"column":5},"end":{"line":19,"column":26}},"11":{"start":{"line":27,"column":3},"end":{"line":34,"column":4}},"12":{"start":{"line":28,"column":3},"end":{"line":33,"column":4}},"13":{"start":{"line":29,"column":4},"end":{"line":29,"column":61}},"14":{"start":{"line":30,"column":4},"end":{"line":30,"column":21}},"15":{"start":{"line":32,"column":5},"end":{"line":32,"column":26}},"16":{"start":{"line":38,"column":2},"end":{"line":45,"column":5}},"17":{"start":{"line":39,"column":3},"end":{"line":44,"column":4}},"18":{"start":{"line":40,"column":4},"end":{"line":40,"column":61}},"19":{"start":{"line":41,"column":4},"end":{"line":41,"column":21}},"20":{"start":{"line":43,"column":4},"end":{"line":43,"column":25}},"21":{"start":{"line":49,"column":2},"end":{"line":56,"column":5}},"22":{"start":{"line":50,"column":3},"end":{"line":55,"column":4}},"23":{"start":{"line":51,"column":4},"end":{"line":51,"column":61}},"24":{"start":{"line":52,"column":4},"end":{"line":52,"column":21}},"25":{"start":{"line":54,"column":4},"end":{"line":54,"column":22}},"26":{"start":{"line":61,"column":2},"end":{"line":68,"column":5}},"27":{"start":{"line":62,"column":3},"end":{"line":67,"column":4}},"28":{"start":{"line":63,"column":4},"end":{"line":63,"column":33}},"29":{"start":{"line":64,"column":4},"end":{"line":64,"column":21}},"30":{"start":{"line":66,"column":4},"end":{"line":66,"column":22}},"31":{"start":{"line":72,"column":0},"end":{"line":72,"column":34}}},"branchMap":{"1":{"line":7,"type":"if","locations":[{"start":{"line":7,"column":3},"end":{"line":7,"column":3}},{"start":{"line":7,"column":3},"end":{"line":7,"column":3}}]},"2":{"line":28,"type":"if","locations":[{"start":{"line":28,"column":3},"end":{"line":28,"column":3}},{"start":{"line":28,"column":3},"end":{"line":28,"column":3}}]},"3":{"line":39,"type":"if","locations":[{"start":{"line":39,"column":3},"end":{"line":39,"column":3}},{"start":{"line":39,"column":3},"end":{"line":39,"column":3}}]},"4":{"line":50,"type":"if","locations":[{"start":{"line":50,"column":3},"end":{"line":50,"column":3}},{"start":{"line":50,"column":3},"end":{"line":50,"column":3}}]},"5":{"line":62,"type":"if","locations":[{"start":{"line":62,"column":3},"end":{"line":62,"column":3}},{"start":{"line":62,"column":3},"end":{"line":62,"column":3}}]}}}} \ No newline at end of file diff --git a/coverage/lcov-report/VideoStoreAPI/app.js.html b/coverage/lcov-report/VideoStoreAPI/app.js.html index c828a0ac5..e796b5455 100644 --- a/coverage/lcov-report/VideoStoreAPI/app.js.html +++ b/coverage/lcov-report/VideoStoreAPI/app.js.html @@ -292,7 +292,7 @@

diff --git a/coverage/lcov-report/VideoStoreAPI/controllers/customers.js.html b/coverage/lcov-report/VideoStoreAPI/controllers/customers.js.html index 9746ad3a2..07ccf4334 100644 --- a/coverage/lcov-report/VideoStoreAPI/controllers/customers.js.html +++ b/coverage/lcov-report/VideoStoreAPI/controllers/customers.js.html @@ -202,7 +202,7 @@

diff --git a/coverage/lcov-report/VideoStoreAPI/controllers/index.html b/coverage/lcov-report/VideoStoreAPI/controllers/index.html index 058c63da4..9c01e9cec 100644 --- a/coverage/lcov-report/VideoStoreAPI/controllers/index.html +++ b/coverage/lcov-report/VideoStoreAPI/controllers/index.html @@ -103,7 +103,7 @@

diff --git a/coverage/lcov-report/VideoStoreAPI/controllers/movies.js.html b/coverage/lcov-report/VideoStoreAPI/controllers/movies.js.html index 29aecc47c..5e382a67b 100644 --- a/coverage/lcov-report/VideoStoreAPI/controllers/movies.js.html +++ b/coverage/lcov-report/VideoStoreAPI/controllers/movies.js.html @@ -184,7 +184,7 @@

diff --git a/coverage/lcov-report/VideoStoreAPI/controllers/rentals.js.html b/coverage/lcov-report/VideoStoreAPI/controllers/rentals.js.html index bd7954f28..e2b9a1437 100644 --- a/coverage/lcov-report/VideoStoreAPI/controllers/rentals.js.html +++ b/coverage/lcov-report/VideoStoreAPI/controllers/rentals.js.html @@ -265,7 +265,7 @@

diff --git a/coverage/lcov-report/VideoStoreAPI/index.html b/coverage/lcov-report/VideoStoreAPI/index.html index e3a5b7493..87f8abea6 100644 --- a/coverage/lcov-report/VideoStoreAPI/index.html +++ b/coverage/lcov-report/VideoStoreAPI/index.html @@ -77,7 +77,7 @@

diff --git a/coverage/lcov-report/VideoStoreAPI/models/customers_model.js.html b/coverage/lcov-report/VideoStoreAPI/models/customers_model.js.html index 9bd8cd2a0..f0e7295cb 100644 --- a/coverage/lcov-report/VideoStoreAPI/models/customers_model.js.html +++ b/coverage/lcov-report/VideoStoreAPI/models/customers_model.js.html @@ -20,28 +20,28 @@

- 64.71% + 88.24% Statements - 11/17 + 15/17
- 25% + 50% Branches - 3/12 + 6/12
- 57.14% + 100% Functions - 4/7 + 7/7
- 64.71% + 88.24% Lines - 11/17 + 15/17
-
+

1 2 @@ -84,16 +84,16 @@

1×   1× -  +400×     1× -  -  +2× +2×     -  -  +2× +400×       @@ -120,17 +120,17 @@

 

var app = require("../app");
 var db = app.get("db");
  
-var Customer = function(id) {
-  this.id = id;
+var Customer = function(id) {
+  this.id = id;
 }
  
-Customer.all = function(callback) {
-  db.customers.find(function(error, customers) {
-    if (error|| !customers) {
+Customer.all = function(callback) {
+  db.customers.find(function(error, customers) {
+    Iif (error|| !customers) {
       callback(error || new Error("Could not retrieve customers"), undefined);
     } else {
-      callback(null, customers.map(function(customer) {
-        return new Customer(customer.id);
+      callback(null, customers.map(function(customer) {
+        return new Customer(customer.id);
       }))
     };
   })
@@ -160,7 +160,7 @@ 

diff --git a/coverage/lcov-report/VideoStoreAPI/models/index.html b/coverage/lcov-report/VideoStoreAPI/models/index.html index d3f4e017b..37b711fb6 100644 --- a/coverage/lcov-report/VideoStoreAPI/models/index.html +++ b/coverage/lcov-report/VideoStoreAPI/models/index.html @@ -20,24 +20,24 @@

- 24.51% + 29.41% Statements - 25/102 + 30/102
- 0% + 5.77% Branches - 0/52 + 3/52
- 0% + 11.43% Functions - 0/35 + 4/35
- 24.51% + 29.41% Lines - 25/102 + 30/102
@@ -59,16 +59,16 @@

customers_model.js
35.29%6/170%0/120%0/735.29%6/17customers_model.js
64.71%11/1725%3/1257.14%4/764.71%11/17
VideoStoreAPI/models/
24.51%25/1020%0/520%0/3524.51%25/102
29.41%30/1025.77%3/5211.43%4/3529.41%30/102
- - - - - - - - - - + + + + + + + + + + @@ -103,7 +103,7 @@

diff --git a/coverage/lcov-report/VideoStoreAPI/models/movies_model.js.html b/coverage/lcov-report/VideoStoreAPI/models/movies_model.js.html index 402ca275f..e2494443f 100644 --- a/coverage/lcov-report/VideoStoreAPI/models/movies_model.js.html +++ b/coverage/lcov-report/VideoStoreAPI/models/movies_model.js.html @@ -199,7 +199,7 @@

diff --git a/coverage/lcov-report/VideoStoreAPI/models/rentals_model.js.html b/coverage/lcov-report/VideoStoreAPI/models/rentals_model.js.html index 0250a52f1..1dcf8ba93 100644 --- a/coverage/lcov-report/VideoStoreAPI/models/rentals_model.js.html +++ b/coverage/lcov-report/VideoStoreAPI/models/rentals_model.js.html @@ -439,7 +439,7 @@

diff --git a/coverage/lcov-report/VideoStoreAPI/routes/customers.js.html b/coverage/lcov-report/VideoStoreAPI/routes/customers.js.html index be58394a5..fa6403162 100644 --- a/coverage/lcov-report/VideoStoreAPI/routes/customers.js.html +++ b/coverage/lcov-report/VideoStoreAPI/routes/customers.js.html @@ -85,7 +85,7 @@

diff --git a/coverage/lcov-report/VideoStoreAPI/routes/index.html b/coverage/lcov-report/VideoStoreAPI/routes/index.html index b4bc1eb4d..0467dd39f 100644 --- a/coverage/lcov-report/VideoStoreAPI/routes/index.html +++ b/coverage/lcov-report/VideoStoreAPI/routes/index.html @@ -116,7 +116,7 @@

diff --git a/coverage/lcov-report/VideoStoreAPI/routes/index.js.html b/coverage/lcov-report/VideoStoreAPI/routes/index.js.html index 4ac236139..7c0bca040 100644 --- a/coverage/lcov-report/VideoStoreAPI/routes/index.js.html +++ b/coverage/lcov-report/VideoStoreAPI/routes/index.js.html @@ -91,7 +91,7 @@

diff --git a/coverage/lcov-report/VideoStoreAPI/routes/movies.js.html b/coverage/lcov-report/VideoStoreAPI/routes/movies.js.html index 82ad9c89e..a17562bf1 100644 --- a/coverage/lcov-report/VideoStoreAPI/routes/movies.js.html +++ b/coverage/lcov-report/VideoStoreAPI/routes/movies.js.html @@ -85,7 +85,7 @@

diff --git a/coverage/lcov-report/VideoStoreAPI/routes/rentals.js.html b/coverage/lcov-report/VideoStoreAPI/routes/rentals.js.html index 16b890e9b..e0bbe2fd3 100644 --- a/coverage/lcov-report/VideoStoreAPI/routes/rentals.js.html +++ b/coverage/lcov-report/VideoStoreAPI/routes/rentals.js.html @@ -100,7 +100,7 @@

diff --git a/coverage/lcov-report/index.html b/coverage/lcov-report/index.html index 8f7c27b86..b0f5a2d78 100644 --- a/coverage/lcov-report/index.html +++ b/coverage/lcov-report/index.html @@ -20,24 +20,24 @@

- 41.46% + 43.09% Statements - 102/246 + 106/246
- 4.88% + 8.54% Branches - 4/82 + 7/82
- 6.06% + 10.61% Functions - 4/66 + 7/66
- 41.46% + 43.09% Lines - 102/246 + 106/246
@@ -86,15 +86,15 @@

- - - - - - - - - + + + + + + + + + @@ -116,7 +116,7 @@

diff --git a/coverage/lcov.info b/coverage/lcov.info index e470aa69a..8484536e2 100644 --- a/coverage/lcov.info +++ b/coverage/lcov.info @@ -161,47 +161,47 @@ FN:20,(anonymous_5) FN:26,(anonymous_6) FN:30,(anonymous_7) FNF:7 -FNH:4 -FNDA:400,(anonymous_1) -FNDA:2,(anonymous_2) -FNDA:2,(anonymous_3) -FNDA:400,(anonymous_4) -FNDA:0,(anonymous_5) -FNDA:0,(anonymous_6) -FNDA:0,(anonymous_7) +FNH:7 +FNDA:200,(anonymous_1) +FNDA:1,(anonymous_2) +FNDA:1,(anonymous_3) +FNDA:200,(anonymous_4) +FNDA:1,(anonymous_5) +FNDA:1,(anonymous_6) +FNDA:2,(anonymous_7) DA:1,1 DA:2,1 DA:4,1 -DA:5,400 +DA:5,200 DA:8,1 -DA:9,2 -DA:10,2 +DA:9,1 +DA:10,1 DA:11,0 -DA:13,2 -DA:14,400 +DA:13,1 +DA:14,200 DA:20,1 -DA:22,0 -DA:27,0 +DA:22,1 +DA:27,1 DA:28,0 -DA:30,0 -DA:31,0 +DA:30,1 +DA:31,2 DA:37,1 LF:17 -LH:11 +LH:15 BRDA:10,1,0,0 -BRDA:10,1,1,2 -BRDA:10,2,0,2 -BRDA:10,2,1,2 +BRDA:10,1,1,1 +BRDA:10,2,0,1 +BRDA:10,2,1,1 BRDA:11,3,0,0 BRDA:11,3,1,0 BRDA:27,4,0,0 -BRDA:27,4,1,0 -BRDA:27,5,0,0 -BRDA:27,5,1,0 +BRDA:27,4,1,1 +BRDA:27,5,0,1 +BRDA:27,5,1,1 BRDA:28,6,0,0 BRDA:28,6,1,0 BRF:12 -BRH:3 +BRH:6 end_of_record TN: SF:/Users/leahpetersen/C5/projects/VideoStoreAPI/models/rentals_model.js diff --git a/npm-debug.log b/npm-debug.log deleted file mode 100644 index 556121583..000000000 --- a/npm-debug.log +++ /dev/null @@ -1,49 +0,0 @@ -0 info it worked if it ends with ok -1 verbose cli [ '/usr/local/Cellar/node/6.2.1/bin/node', -1 verbose cli '/usr/local/bin/npm', -1 verbose cli 'run', -1 verbose cli 'test' ] -2 info using npm@3.9.3 -3 info using node@v6.2.1 -4 verbose run-script [ 'pretest', 'test', 'posttest' ] -5 info lifecycle video-store-api@0.0.0~pretest: video-store-api@0.0.0 -6 silly lifecycle video-store-api@0.0.0~pretest: no script for pretest, continuing -7 info lifecycle video-store-api@0.0.0~test: video-store-api@0.0.0 -8 verbose lifecycle video-store-api@0.0.0~test: unsafe-perm in lifecycle true -9 verbose lifecycle video-store-api@0.0.0~test: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/leahpetersen/C5/projects/VideoStoreAPI/node_modules/.bin:/usr/local/Cellar/node/6.2.1/bin:/Users/leahpetersen/google-cloud-sdk/bin:/Users/leahpetersen/.rvm/gems/ruby-2.3.1/bin:/Users/leahpetersen/.rvm/gems/ruby-2.3.1@global/bin:/Users/leahpetersen/.rvm/rubies/ruby-2.3.1/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/leahpetersen/.rvm/bin:/Users/leahpetersen/.rvm/bin:/Users/leahpetersen/.rvm/bin -10 verbose lifecycle video-store-api@0.0.0~test: CWD: /Users/leahpetersen/C5/projects/VideoStoreAPI -11 silly lifecycle video-store-api@0.0.0~test: Args: [ '-c', -11 silly lifecycle 'clear; ./node_modules/.bin/istanbul cover -x \'spec/**/*\' -- ./node_modules/.bin/jasmine-node --captureExceptions --verbose spec/' ] -12 silly lifecycle video-store-api@0.0.0~test: Returned: code: 1 signal: null -13 info lifecycle video-store-api@0.0.0~test: Failed to exec test script -14 verbose stack Error: video-store-api@0.0.0 test: `clear; ./node_modules/.bin/istanbul cover -x 'spec/**/*' -- ./node_modules/.bin/jasmine-node --captureExceptions --verbose spec/` -14 verbose stack Exit status 1 -14 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:245:16) -14 verbose stack at emitTwo (events.js:106:13) -14 verbose stack at EventEmitter.emit (events.js:191:7) -14 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14) -14 verbose stack at emitTwo (events.js:106:13) -14 verbose stack at ChildProcess.emit (events.js:191:7) -14 verbose stack at maybeClose (internal/child_process.js:852:16) -14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5) -15 verbose pkgid video-store-api@0.0.0 -16 verbose cwd /Users/leahpetersen/C5/projects/VideoStoreAPI -17 error Darwin 15.5.0 -18 error argv "/usr/local/Cellar/node/6.2.1/bin/node" "/usr/local/bin/npm" "run" "test" -19 error node v6.2.1 -20 error npm v3.9.3 -21 error code ELIFECYCLE -22 error video-store-api@0.0.0 test: `clear; ./node_modules/.bin/istanbul cover -x 'spec/**/*' -- ./node_modules/.bin/jasmine-node --captureExceptions --verbose spec/` -22 error Exit status 1 -23 error Failed at the video-store-api@0.0.0 test script 'clear; ./node_modules/.bin/istanbul cover -x 'spec/**/*' -- ./node_modules/.bin/jasmine-node --captureExceptions --verbose spec/'. -23 error Make sure you have the latest version of node.js and npm installed. -23 error If you do, this is most likely a problem with the video-store-api package, -23 error not with npm itself. -23 error Tell the author that this fails on your system: -23 error clear; ./node_modules/.bin/istanbul cover -x 'spec/**/*' -- ./node_modules/.bin/jasmine-node --captureExceptions --verbose spec/ -23 error You can get information on how to open an issue for this project with: -23 error npm bugs video-store-api -23 error Or if that isn't available, you can get their info via: -23 error npm owner ls video-store-api -23 error There is likely additional logging output above. -24 verbose exit [ 1, true ] diff --git a/spec/models/customers_model.spec.js b/spec/models/customers_model.spec.js index 537088a02..2879ec874 100644 --- a/spec/models/customers_model.spec.js +++ b/spec/models/customers_model.spec.js @@ -26,7 +26,7 @@ describe('#all', function () { describe('#sort', function () { it('should return an array of customers', function (done) { - Customer.all(function (error, data) { + Customer.sort('name', 10, 2, function (error, data) { expect(typeof data).toEqual('object') done() }) From c1f33589a9e4d861c01d4084711f5290b42f567e Mon Sep 17 00:00:00 2001 From: Leah Date: Thu, 23 Jun 2016 20:24:43 -0700 Subject: [PATCH 51/69] ignore coverage/ directory --- .gitignore | 1 + coverage/coverage.json | 1 - .../lcov-report/VideoStoreAPI/app.js.html | 308 ---------- .../controllers/customers.js.html | 218 ------- .../VideoStoreAPI/controllers/index.html | 119 ---- .../VideoStoreAPI/controllers/movies.js.html | 200 ------- .../VideoStoreAPI/controllers/rentals.js.html | 281 --------- coverage/lcov-report/VideoStoreAPI/index.html | 93 --- .../models/customers_model.js.html | 176 ------ .../VideoStoreAPI/models/index.html | 119 ---- .../VideoStoreAPI/models/movies_model.js.html | 215 ------- .../models/rentals_model.js.html | 455 -------------- .../VideoStoreAPI/routes/customers.js.html | 101 ---- .../VideoStoreAPI/routes/index.html | 132 ----- .../VideoStoreAPI/routes/index.js.html | 107 ---- .../VideoStoreAPI/routes/movies.js.html | 101 ---- .../VideoStoreAPI/routes/rentals.js.html | 116 ---- coverage/lcov-report/base.css | 213 ------- coverage/lcov-report/index.html | 132 ----- coverage/lcov-report/prettify.css | 1 - coverage/lcov-report/prettify.js | 1 - coverage/lcov-report/sort-arrow-sprite.png | Bin 209 -> 0 bytes coverage/lcov-report/sorter.js | 158 ----- coverage/lcov.info | 559 ------------------ 24 files changed, 1 insertion(+), 3806 deletions(-) delete mode 100644 coverage/coverage.json delete mode 100644 coverage/lcov-report/VideoStoreAPI/app.js.html delete mode 100644 coverage/lcov-report/VideoStoreAPI/controllers/customers.js.html delete mode 100644 coverage/lcov-report/VideoStoreAPI/controllers/index.html delete mode 100644 coverage/lcov-report/VideoStoreAPI/controllers/movies.js.html delete mode 100644 coverage/lcov-report/VideoStoreAPI/controllers/rentals.js.html delete mode 100644 coverage/lcov-report/VideoStoreAPI/index.html delete mode 100644 coverage/lcov-report/VideoStoreAPI/models/customers_model.js.html delete mode 100644 coverage/lcov-report/VideoStoreAPI/models/index.html delete mode 100644 coverage/lcov-report/VideoStoreAPI/models/movies_model.js.html delete mode 100644 coverage/lcov-report/VideoStoreAPI/models/rentals_model.js.html delete mode 100644 coverage/lcov-report/VideoStoreAPI/routes/customers.js.html delete mode 100644 coverage/lcov-report/VideoStoreAPI/routes/index.html delete mode 100644 coverage/lcov-report/VideoStoreAPI/routes/index.js.html delete mode 100644 coverage/lcov-report/VideoStoreAPI/routes/movies.js.html delete mode 100644 coverage/lcov-report/VideoStoreAPI/routes/rentals.js.html delete mode 100644 coverage/lcov-report/base.css delete mode 100644 coverage/lcov-report/index.html delete mode 100644 coverage/lcov-report/prettify.css delete mode 100644 coverage/lcov-report/prettify.js delete mode 100644 coverage/lcov-report/sort-arrow-sprite.png delete mode 100644 coverage/lcov-report/sorter.js delete mode 100644 coverage/lcov.info diff --git a/.gitignore b/.gitignore index 646ac519e..be2d1737f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .DS_Store +coverage/ node_modules/ diff --git a/coverage/coverage.json b/coverage/coverage.json deleted file mode 100644 index f4a74afae..000000000 --- a/coverage/coverage.json +++ /dev/null @@ -1 +0,0 @@ -{"/Users/leahpetersen/C5/projects/VideoStoreAPI/app.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/app.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":1,"19":1,"20":1,"21":1,"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":0,"29":0,"30":0,"31":1,"32":0,"33":0,"34":0,"35":1,"36":0,"37":0,"38":1},"b":{"1":[0,1],"2":[0,0],"3":[0,0]},"f":{"1":0,"2":0,"3":0},"fnMap":{"1":{"name":"(anonymous_1)","line":50,"loc":{"start":{"line":50,"column":8},"end":{"line":50,"column":33}}},"2":{"name":"(anonymous_2)","line":61,"loc":{"start":{"line":61,"column":10},"end":{"line":61,"column":40}}},"3":{"name":"(anonymous_3)","line":72,"loc":{"start":{"line":72,"column":8},"end":{"line":72,"column":38}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":27}},"3":{"start":{"line":3,"column":0},"end":{"line":3,"column":39}},"4":{"start":{"line":4,"column":0},"end":{"line":4,"column":31}},"5":{"start":{"line":5,"column":0},"end":{"line":5,"column":44}},"6":{"start":{"line":6,"column":0},"end":{"line":6,"column":40}},"7":{"start":{"line":7,"column":0},"end":{"line":7,"column":33}},"8":{"start":{"line":8,"column":0},"end":{"line":8,"column":37}},"9":{"start":{"line":11,"column":0},"end":{"line":11,"column":76}},"10":{"start":{"line":16,"column":0},"end":{"line":16,"column":80}},"11":{"start":{"line":19,"column":0},"end":{"line":19,"column":31}},"12":{"start":{"line":23,"column":0},"end":{"line":23,"column":48}},"13":{"start":{"line":24,"column":0},"end":{"line":24,"column":31}},"14":{"start":{"line":28,"column":0},"end":{"line":28,"column":23}},"15":{"start":{"line":31,"column":0},"end":{"line":31,"column":27}},"16":{"start":{"line":32,"column":0},"end":{"line":32,"column":52}},"17":{"start":{"line":33,"column":0},"end":{"line":33,"column":24}},"18":{"start":{"line":34,"column":0},"end":{"line":34,"column":56}},"19":{"start":{"line":36,"column":0},"end":{"line":36,"column":42}},"20":{"start":{"line":37,"column":0},"end":{"line":37,"column":46}},"21":{"start":{"line":38,"column":0},"end":{"line":38,"column":43}},"22":{"start":{"line":39,"column":0},"end":{"line":39,"column":44}},"23":{"start":{"line":43,"column":0},"end":{"line":43,"column":21}},"24":{"start":{"line":44,"column":0},"end":{"line":44,"column":33}},"25":{"start":{"line":45,"column":0},"end":{"line":45,"column":27}},"26":{"start":{"line":46,"column":0},"end":{"line":46,"column":29}},"27":{"start":{"line":50,"column":0},"end":{"line":54,"column":3}},"28":{"start":{"line":51,"column":2},"end":{"line":51,"column":35}},"29":{"start":{"line":52,"column":2},"end":{"line":52,"column":19}},"30":{"start":{"line":53,"column":2},"end":{"line":53,"column":12}},"31":{"start":{"line":60,"column":0},"end":{"line":68,"column":1}},"32":{"start":{"line":61,"column":2},"end":{"line":67,"column":5}},"33":{"start":{"line":62,"column":4},"end":{"line":62,"column":34}},"34":{"start":{"line":63,"column":4},"end":{"line":66,"column":7}},"35":{"start":{"line":72,"column":0},"end":{"line":78,"column":3}},"36":{"start":{"line":73,"column":2},"end":{"line":73,"column":32}},"37":{"start":{"line":74,"column":2},"end":{"line":77,"column":5}},"38":{"start":{"line":81,"column":0},"end":{"line":81,"column":21}}},"branchMap":{"1":{"line":60,"type":"if","locations":[{"start":{"line":60,"column":0},"end":{"line":60,"column":0}},{"start":{"line":60,"column":0},"end":{"line":60,"column":0}}]},"2":{"line":62,"type":"binary-expr","locations":[{"start":{"line":62,"column":15},"end":{"line":62,"column":25}},{"start":{"line":62,"column":29},"end":{"line":62,"column":32}}]},"3":{"line":73,"type":"binary-expr","locations":[{"start":{"line":73,"column":13},"end":{"line":73,"column":23}},{"start":{"line":73,"column":27},"end":{"line":73,"column":30}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/index.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/index.js","s":{"1":1,"2":1,"3":1,"4":0,"5":1,"6":0,"7":1},"b":{},"f":{"1":0,"2":0},"fnMap":{"1":{"name":"(anonymous_1)","line":6,"loc":{"start":{"line":6,"column":16},"end":{"line":6,"column":41}}},"2":{"name":"(anonymous_2)","line":10,"loc":{"start":{"line":10,"column":20},"end":{"line":10,"column":45}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}},"3":{"start":{"line":6,"column":0},"end":{"line":8,"column":3}},"4":{"start":{"line":7,"column":2},"end":{"line":7,"column":40}},"5":{"start":{"line":10,"column":0},"end":{"line":12,"column":3}},"6":{"start":{"line":11,"column":2},"end":{"line":11,"column":49}},"7":{"start":{"line":14,"column":0},"end":{"line":14,"column":24}}},"branchMap":{}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/customers.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/customers.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1},"b":{},"f":{},"fnMap":{},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}},"3":{"start":{"line":3,"column":0},"end":{"line":3,"column":52}},"4":{"start":{"line":6,"column":0},"end":{"line":6,"column":40}},"5":{"start":{"line":7,"column":0},"end":{"line":7,"column":55}},"6":{"start":{"line":8,"column":0},"end":{"line":8,"column":67}},"7":{"start":{"line":9,"column":0},"end":{"line":9,"column":67}},"8":{"start":{"line":12,"column":0},"end":{"line":12,"column":24}}},"branchMap":{}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/customers.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/customers.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0},"fnMap":{"1":{"name":"(anonymous_1)","line":6,"loc":{"start":{"line":6,"column":15},"end":{"line":6,"column":34}}},"2":{"name":"(anonymous_2)","line":7,"loc":{"start":{"line":7,"column":15},"end":{"line":7,"column":42}}},"3":{"name":"(anonymous_3)","line":17,"loc":{"start":{"line":17,"column":18},"end":{"line":17,"column":37}}},"4":{"name":"(anonymous_4)","line":18,"loc":{"start":{"line":18,"column":61},"end":{"line":18,"column":83}}},"5":{"name":"(anonymous_5)","line":29,"loc":{"start":{"line":29,"column":22},"end":{"line":29,"column":41}}},"6":{"name":"(anonymous_6)","line":30,"loc":{"start":{"line":30,"column":51},"end":{"line":30,"column":73}}},"7":{"name":"(anonymous_7)","line":40,"loc":{"start":{"line":40,"column":22},"end":{"line":40,"column":41}}},"8":{"name":"(anonymous_8)","line":41,"loc":{"start":{"line":41,"column":48},"end":{"line":41,"column":70}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":48}},"3":{"start":{"line":5,"column":0},"end":{"line":50,"column":1}},"4":{"start":{"line":7,"column":2},"end":{"line":14,"column":4}},"5":{"start":{"line":8,"column":3},"end":{"line":13,"column":4}},"6":{"start":{"line":9,"column":4},"end":{"line":9,"column":76}},"7":{"start":{"line":10,"column":4},"end":{"line":10,"column":21}},"8":{"start":{"line":12,"column":4},"end":{"line":12,"column":23}},"9":{"start":{"line":18,"column":2},"end":{"line":25,"column":4}},"10":{"start":{"line":19,"column":3},"end":{"line":24,"column":4}},"11":{"start":{"line":20,"column":4},"end":{"line":20,"column":40}},"12":{"start":{"line":21,"column":4},"end":{"line":21,"column":21}},"13":{"start":{"line":23,"column":4},"end":{"line":23,"column":18}},"14":{"start":{"line":30,"column":2},"end":{"line":37,"column":4}},"15":{"start":{"line":31,"column":3},"end":{"line":36,"column":4}},"16":{"start":{"line":32,"column":4},"end":{"line":32,"column":40}},"17":{"start":{"line":33,"column":4},"end":{"line":33,"column":21}},"18":{"start":{"line":35,"column":4},"end":{"line":35,"column":18}},"19":{"start":{"line":41,"column":2},"end":{"line":48,"column":4}},"20":{"start":{"line":42,"column":3},"end":{"line":47,"column":4}},"21":{"start":{"line":43,"column":4},"end":{"line":43,"column":40}},"22":{"start":{"line":44,"column":4},"end":{"line":44,"column":21}},"23":{"start":{"line":46,"column":4},"end":{"line":46,"column":18}},"24":{"start":{"line":51,"column":0},"end":{"line":51,"column":36}}},"branchMap":{"1":{"line":8,"type":"if","locations":[{"start":{"line":8,"column":3},"end":{"line":8,"column":3}},{"start":{"line":8,"column":3},"end":{"line":8,"column":3}}]},"2":{"line":19,"type":"if","locations":[{"start":{"line":19,"column":3},"end":{"line":19,"column":3}},{"start":{"line":19,"column":3},"end":{"line":19,"column":3}}]},"3":{"line":31,"type":"if","locations":[{"start":{"line":31,"column":3},"end":{"line":31,"column":3}},{"start":{"line":31,"column":3},"end":{"line":31,"column":3}}]},"4":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":3},"end":{"line":42,"column":3}},{"start":{"line":42,"column":3},"end":{"line":42,"column":3}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/customers_model.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/customers_model.js","s":{"1":1,"2":1,"3":1,"4":200,"5":1,"6":1,"7":1,"8":0,"9":1,"10":200,"11":1,"12":1,"13":1,"14":0,"15":1,"16":2,"17":1},"b":{"1":[0,1],"2":[1,1],"3":[0,0],"4":[0,1],"5":[1,1],"6":[0,0]},"f":{"1":200,"2":1,"3":1,"4":200,"5":1,"6":1,"7":2},"fnMap":{"1":{"name":"(anonymous_1)","line":4,"loc":{"start":{"line":4,"column":15},"end":{"line":4,"column":28}}},"2":{"name":"(anonymous_2)","line":8,"loc":{"start":{"line":8,"column":15},"end":{"line":8,"column":34}}},"3":{"name":"(anonymous_3)","line":9,"loc":{"start":{"line":9,"column":20},"end":{"line":9,"column":47}}},"4":{"name":"(anonymous_4)","line":13,"loc":{"start":{"line":13,"column":35},"end":{"line":13,"column":54}}},"5":{"name":"(anonymous_5)","line":20,"loc":{"start":{"line":20,"column":16},"end":{"line":20,"column":49}}},"6":{"name":"(anonymous_6)","line":26,"loc":{"start":{"line":26,"column":5},"end":{"line":26,"column":32}}},"7":{"name":"(anonymous_7)","line":30,"loc":{"start":{"line":30,"column":36},"end":{"line":30,"column":56}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}},"3":{"start":{"line":4,"column":0},"end":{"line":6,"column":1}},"4":{"start":{"line":5,"column":2},"end":{"line":5,"column":15}},"5":{"start":{"line":8,"column":0},"end":{"line":18,"column":2}},"6":{"start":{"line":9,"column":2},"end":{"line":17,"column":4}},"7":{"start":{"line":10,"column":4},"end":{"line":16,"column":5}},"8":{"start":{"line":11,"column":6},"end":{"line":11,"column":78}},"9":{"start":{"line":13,"column":6},"end":{"line":15,"column":9}},"10":{"start":{"line":14,"column":8},"end":{"line":14,"column":41}},"11":{"start":{"line":20,"column":0},"end":{"line":35,"column":1}},"12":{"start":{"line":22,"column":1},"end":{"line":34,"column":4}},"13":{"start":{"line":27,"column":4},"end":{"line":33,"column":5}},"14":{"start":{"line":28,"column":6},"end":{"line":28,"column":77}},"15":{"start":{"line":30,"column":6},"end":{"line":32,"column":9}},"16":{"start":{"line":31,"column":8},"end":{"line":31,"column":23}},"17":{"start":{"line":37,"column":0},"end":{"line":37,"column":26}}},"branchMap":{"1":{"line":10,"type":"if","locations":[{"start":{"line":10,"column":4},"end":{"line":10,"column":4}},{"start":{"line":10,"column":4},"end":{"line":10,"column":4}}]},"2":{"line":10,"type":"binary-expr","locations":[{"start":{"line":10,"column":8},"end":{"line":10,"column":13}},{"start":{"line":10,"column":16},"end":{"line":10,"column":26}}]},"3":{"line":11,"type":"binary-expr","locations":[{"start":{"line":11,"column":15},"end":{"line":11,"column":20}},{"start":{"line":11,"column":24},"end":{"line":11,"column":65}}]},"4":{"line":27,"type":"if","locations":[{"start":{"line":27,"column":4},"end":{"line":27,"column":4}},{"start":{"line":27,"column":4},"end":{"line":27,"column":4}}]},"5":{"line":27,"type":"binary-expr","locations":[{"start":{"line":27,"column":8},"end":{"line":27,"column":13}},{"start":{"line":27,"column":17},"end":{"line":27,"column":27}}]},"6":{"line":28,"type":"binary-expr","locations":[{"start":{"line":28,"column":15},"end":{"line":28,"column":20}},{"start":{"line":28,"column":24},"end":{"line":28,"column":65}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/rentals_model.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/rentals_model.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":1,"11":0,"12":0,"13":0,"14":0,"15":1,"16":0,"17":0,"18":0,"19":0,"20":1,"21":0,"22":0,"23":0,"24":0,"25":1,"26":0,"27":0,"28":0,"29":0,"30":1,"31":0,"32":0,"33":0,"34":0,"35":1,"36":0,"37":0,"38":0,"39":0,"40":0,"41":1,"42":0,"43":0,"44":0,"45":0,"46":1,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0},"fnMap":{"1":{"name":"(anonymous_1)","line":4,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":109}}},"2":{"name":"(anonymous_2)","line":14,"loc":{"start":{"line":14,"column":23},"end":{"line":14,"column":49}}},"3":{"name":"(anonymous_3)","line":15,"loc":{"start":{"line":15,"column":63},"end":{"line":15,"column":92}}},"4":{"name":"(anonymous_4)","line":24,"loc":{"start":{"line":24,"column":27},"end":{"line":24,"column":59}}},"5":{"name":"(anonymous_5)","line":25,"loc":{"start":{"line":25,"column":75},"end":{"line":25,"column":104}}},"6":{"name":"(anonymous_6)","line":34,"loc":{"start":{"line":34,"column":32},"end":{"line":34,"column":58}}},"7":{"name":"(anonymous_7)","line":35,"loc":{"start":{"line":35,"column":58},"end":{"line":35,"column":82}}},"8":{"name":"(anonymous_8)","line":44,"loc":{"start":{"line":44,"column":24},"end":{"line":44,"column":56}}},"9":{"name":"(anonymous_9)","line":45,"loc":{"start":{"line":45,"column":168},"end":{"line":45,"column":198}}},"10":{"name":"(anonymous_10)","line":54,"loc":{"start":{"line":54,"column":22},"end":{"line":54,"column":54}}},"11":{"name":"(anonymous_11)","line":55,"loc":{"start":{"line":55,"column":167},"end":{"line":55,"column":194}}},"12":{"name":"(anonymous_12)","line":64,"loc":{"start":{"line":64,"column":20},"end":{"line":64,"column":39}}},"13":{"name":"(anonymous_13)","line":66,"loc":{"start":{"line":66,"column":266},"end":{"line":66,"column":293}}},"14":{"name":"(anonymous_14)","line":74,"loc":{"start":{"line":74,"column":19},"end":{"line":74,"column":49}}},"15":{"name":"(anonymous_15)","line":79,"loc":{"start":{"line":79,"column":7},"end":{"line":79,"column":36}}},"16":{"name":"(anonymous_16)","line":88,"loc":{"start":{"line":88,"column":21},"end":{"line":88,"column":57}}},"17":{"name":"(anonymous_17)","line":93,"loc":{"start":{"line":93,"column":5},"end":{"line":93,"column":29}}},"18":{"name":"(anonymous_18)","line":101,"loc":{"start":{"line":101,"column":90},"end":{"line":101,"column":149}}},"19":{"name":"(anonymous_19)","line":119,"loc":{"start":{"line":119,"column":9},"end":{"line":119,"column":34}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}},"3":{"start":{"line":4,"column":0},"end":{"line":12,"column":2}},"4":{"start":{"line":5,"column":2},"end":{"line":5,"column":27}},"5":{"start":{"line":6,"column":2},"end":{"line":6,"column":33}},"6":{"start":{"line":7,"column":2},"end":{"line":7,"column":35}},"7":{"start":{"line":8,"column":2},"end":{"line":8,"column":27}},"8":{"start":{"line":9,"column":2},"end":{"line":9,"column":27}},"9":{"start":{"line":10,"column":2},"end":{"line":10,"column":37}},"10":{"start":{"line":14,"column":0},"end":{"line":22,"column":1}},"11":{"start":{"line":15,"column":2},"end":{"line":21,"column":4}},"12":{"start":{"line":16,"column":4},"end":{"line":20,"column":5}},"13":{"start":{"line":17,"column":6},"end":{"line":17,"column":33}},"14":{"start":{"line":19,"column":6},"end":{"line":19,"column":34}},"15":{"start":{"line":24,"column":0},"end":{"line":32,"column":1}},"16":{"start":{"line":25,"column":2},"end":{"line":31,"column":4}},"17":{"start":{"line":26,"column":4},"end":{"line":30,"column":5}},"18":{"start":{"line":27,"column":6},"end":{"line":27,"column":33}},"19":{"start":{"line":29,"column":6},"end":{"line":29,"column":34}},"20":{"start":{"line":34,"column":0},"end":{"line":42,"column":1}},"21":{"start":{"line":35,"column":2},"end":{"line":41,"column":4}},"22":{"start":{"line":36,"column":4},"end":{"line":40,"column":5}},"23":{"start":{"line":37,"column":6},"end":{"line":37,"column":22}},"24":{"start":{"line":39,"column":6},"end":{"line":39,"column":28}},"25":{"start":{"line":44,"column":0},"end":{"line":52,"column":1}},"26":{"start":{"line":45,"column":2},"end":{"line":51,"column":4}},"27":{"start":{"line":46,"column":4},"end":{"line":50,"column":5}},"28":{"start":{"line":47,"column":6},"end":{"line":47,"column":33}},"29":{"start":{"line":49,"column":6},"end":{"line":49,"column":35}},"30":{"start":{"line":54,"column":0},"end":{"line":62,"column":1}},"31":{"start":{"line":55,"column":2},"end":{"line":61,"column":4}},"32":{"start":{"line":56,"column":4},"end":{"line":60,"column":5}},"33":{"start":{"line":57,"column":6},"end":{"line":57,"column":33}},"34":{"start":{"line":59,"column":6},"end":{"line":59,"column":32}},"35":{"start":{"line":64,"column":0},"end":{"line":72,"column":1}},"36":{"start":{"line":65,"column":2},"end":{"line":65,"column":22}},"37":{"start":{"line":66,"column":2},"end":{"line":71,"column":7}},"38":{"start":{"line":67,"column":4},"end":{"line":69,"column":5}},"39":{"start":{"line":68,"column":6},"end":{"line":68,"column":33}},"40":{"start":{"line":70,"column":4},"end":{"line":70,"column":29}},"41":{"start":{"line":74,"column":0},"end":{"line":86,"column":1}},"42":{"start":{"line":75,"column":2},"end":{"line":85,"column":4}},"43":{"start":{"line":80,"column":4},"end":{"line":84,"column":5}},"44":{"start":{"line":81,"column":6},"end":{"line":81,"column":33}},"45":{"start":{"line":83,"column":6},"end":{"line":83,"column":34}},"46":{"start":{"line":88,"column":0},"end":{"line":128,"column":1}},"47":{"start":{"line":90,"column":2},"end":{"line":127,"column":5}},"48":{"start":{"line":94,"column":4},"end":{"line":98,"column":5}},"49":{"start":{"line":95,"column":6},"end":{"line":95,"column":29}},"50":{"start":{"line":96,"column":11},"end":{"line":98,"column":5}},"51":{"start":{"line":97,"column":6},"end":{"line":97,"column":52}},"52":{"start":{"line":101,"column":6},"end":{"line":126,"column":7}},"53":{"start":{"line":102,"column":8},"end":{"line":104,"column":9}},"54":{"start":{"line":103,"column":10},"end":{"line":103,"column":33}},"55":{"start":{"line":107,"column":6},"end":{"line":107,"column":27}},"56":{"start":{"line":108,"column":6},"end":{"line":108,"column":30}},"57":{"start":{"line":109,"column":6},"end":{"line":109,"column":37}},"58":{"start":{"line":112,"column":6},"end":{"line":125,"column":9}},"59":{"start":{"line":120,"column":8},"end":{"line":122,"column":9}},"60":{"start":{"line":121,"column":10},"end":{"line":121,"column":33}},"61":{"start":{"line":124,"column":8},"end":{"line":124,"column":38}},"62":{"start":{"line":130,"column":0},"end":{"line":130,"column":24}}},"branchMap":{"1":{"line":16,"type":"if","locations":[{"start":{"line":16,"column":4},"end":{"line":16,"column":4}},{"start":{"line":16,"column":4},"end":{"line":16,"column":4}}]},"2":{"line":26,"type":"if","locations":[{"start":{"line":26,"column":4},"end":{"line":26,"column":4}},{"start":{"line":26,"column":4},"end":{"line":26,"column":4}}]},"3":{"line":36,"type":"if","locations":[{"start":{"line":36,"column":4},"end":{"line":36,"column":4}},{"start":{"line":36,"column":4},"end":{"line":36,"column":4}}]},"4":{"line":46,"type":"if","locations":[{"start":{"line":46,"column":4},"end":{"line":46,"column":4}},{"start":{"line":46,"column":4},"end":{"line":46,"column":4}}]},"5":{"line":56,"type":"if","locations":[{"start":{"line":56,"column":4},"end":{"line":56,"column":4}},{"start":{"line":56,"column":4},"end":{"line":56,"column":4}}]},"6":{"line":67,"type":"if","locations":[{"start":{"line":67,"column":4},"end":{"line":67,"column":4}},{"start":{"line":67,"column":4},"end":{"line":67,"column":4}}]},"7":{"line":80,"type":"if","locations":[{"start":{"line":80,"column":4},"end":{"line":80,"column":4}},{"start":{"line":80,"column":4},"end":{"line":80,"column":4}}]},"8":{"line":94,"type":"if","locations":[{"start":{"line":94,"column":4},"end":{"line":94,"column":4}},{"start":{"line":94,"column":4},"end":{"line":94,"column":4}}]},"9":{"line":96,"type":"if","locations":[{"start":{"line":96,"column":11},"end":{"line":96,"column":11}},{"start":{"line":96,"column":11},"end":{"line":96,"column":11}}]},"10":{"line":102,"type":"if","locations":[{"start":{"line":102,"column":8},"end":{"line":102,"column":8}},{"start":{"line":102,"column":8},"end":{"line":102,"column":8}}]},"11":{"line":120,"type":"if","locations":[{"start":{"line":120,"column":8},"end":{"line":120,"column":8}},{"start":{"line":120,"column":8},"end":{"line":120,"column":8}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/movies.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/movies.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1},"b":{},"f":{},"fnMap":{},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}},"3":{"start":{"line":3,"column":0},"end":{"line":3,"column":49}},"4":{"start":{"line":6,"column":0},"end":{"line":6,"column":37}},"5":{"start":{"line":7,"column":0},"end":{"line":7,"column":52}},"6":{"start":{"line":8,"column":0},"end":{"line":8,"column":61}},"7":{"start":{"line":9,"column":0},"end":{"line":9,"column":58}},"8":{"start":{"line":12,"column":0},"end":{"line":12,"column":24}}},"branchMap":{}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/movies.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/movies.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0},"fnMap":{"1":{"name":"(anonymous_1)","line":6,"loc":{"start":{"line":6,"column":12},"end":{"line":6,"column":31}}},"2":{"name":"(anonymous_2)","line":7,"loc":{"start":{"line":7,"column":12},"end":{"line":7,"column":36}}},"3":{"name":"(anonymous_3)","line":17,"loc":{"start":{"line":17,"column":15},"end":{"line":17,"column":34}}},"4":{"name":"(anonymous_4)","line":18,"loc":{"start":{"line":18,"column":58},"end":{"line":18,"column":80}}},"5":{"name":"(anonymous_5)","line":29,"loc":{"start":{"line":29,"column":22},"end":{"line":29,"column":41}}},"6":{"name":"(anonymous_6)","line":30,"loc":{"start":{"line":30,"column":41},"end":{"line":30,"column":70}}},"7":{"name":"(anonymous_7)","line":40,"loc":{"start":{"line":40,"column":19},"end":{"line":40,"column":38}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":48}},"3":{"start":{"line":5,"column":0},"end":{"line":43,"column":1}},"4":{"start":{"line":7,"column":2},"end":{"line":14,"column":4}},"5":{"start":{"line":8,"column":3},"end":{"line":13,"column":4}},"6":{"start":{"line":9,"column":4},"end":{"line":9,"column":74}},"7":{"start":{"line":10,"column":4},"end":{"line":10,"column":21}},"8":{"start":{"line":12,"column":4},"end":{"line":12,"column":20}},"9":{"start":{"line":18,"column":2},"end":{"line":26,"column":4}},"10":{"start":{"line":19,"column":3},"end":{"line":24,"column":4}},"11":{"start":{"line":20,"column":4},"end":{"line":20,"column":40}},"12":{"start":{"line":21,"column":4},"end":{"line":21,"column":21}},"13":{"start":{"line":23,"column":4},"end":{"line":23,"column":18}},"14":{"start":{"line":30,"column":3},"end":{"line":37,"column":4}},"15":{"start":{"line":31,"column":3},"end":{"line":36,"column":4}},"16":{"start":{"line":32,"column":4},"end":{"line":32,"column":61}},"17":{"start":{"line":33,"column":4},"end":{"line":33,"column":21}},"18":{"start":{"line":35,"column":5},"end":{"line":35,"column":26}},"19":{"start":{"line":45,"column":0},"end":{"line":45,"column":33}}},"branchMap":{"1":{"line":8,"type":"if","locations":[{"start":{"line":8,"column":3},"end":{"line":8,"column":3}},{"start":{"line":8,"column":3},"end":{"line":8,"column":3}}]},"2":{"line":19,"type":"if","locations":[{"start":{"line":19,"column":3},"end":{"line":19,"column":3}},{"start":{"line":19,"column":3},"end":{"line":19,"column":3}}]},"3":{"line":31,"type":"if","locations":[{"start":{"line":31,"column":3},"end":{"line":31,"column":3}},{"start":{"line":31,"column":3},"end":{"line":31,"column":3}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/movies_model.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/models/movies_model.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":1,"7":0,"8":0,"9":0,"10":0,"11":0,"12":1,"13":0,"14":0,"15":0,"16":0,"17":1,"18":0,"19":0,"20":0,"21":0,"22":0,"23":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0},"fnMap":{"1":{"name":"(anonymous_1)","line":4,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":39}}},"2":{"name":"(anonymous_2)","line":9,"loc":{"start":{"line":9,"column":12},"end":{"line":9,"column":31}}},"3":{"name":"(anonymous_3)","line":10,"loc":{"start":{"line":10,"column":17},"end":{"line":10,"column":41}}},"4":{"name":"(anonymous_4)","line":14,"loc":{"start":{"line":14,"column":32},"end":{"line":14,"column":48}}},"5":{"name":"(anonymous_5)","line":21,"loc":{"start":{"line":21,"column":18},"end":{"line":21,"column":44}}},"6":{"name":"(anonymous_6)","line":22,"loc":{"start":{"line":22,"column":36},"end":{"line":22,"column":59}}},"7":{"name":"(anonymous_7)","line":33,"loc":{"start":{"line":33,"column":13},"end":{"line":33,"column":46}}},"8":{"name":"(anonymous_8)","line":39,"loc":{"start":{"line":39,"column":5},"end":{"line":39,"column":29}}},"9":{"name":"(anonymous_9)","line":43,"loc":{"start":{"line":43,"column":33},"end":{"line":43,"column":50}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}},"3":{"start":{"line":4,"column":0},"end":{"line":7,"column":1}},"4":{"start":{"line":5,"column":2},"end":{"line":5,"column":21}},"5":{"start":{"line":6,"column":2},"end":{"line":6,"column":29}},"6":{"start":{"line":9,"column":0},"end":{"line":19,"column":2}},"7":{"start":{"line":10,"column":2},"end":{"line":18,"column":4}},"8":{"start":{"line":11,"column":4},"end":{"line":17,"column":5}},"9":{"start":{"line":12,"column":6},"end":{"line":12,"column":75}},"10":{"start":{"line":14,"column":6},"end":{"line":16,"column":9}},"11":{"start":{"line":15,"column":8},"end":{"line":15,"column":38}},"12":{"start":{"line":21,"column":0},"end":{"line":31,"column":2}},"13":{"start":{"line":22,"column":2},"end":{"line":30,"column":4}},"14":{"start":{"line":24,"column":4},"end":{"line":29,"column":5}},"15":{"start":{"line":26,"column":6},"end":{"line":26,"column":65}},"16":{"start":{"line":28,"column":6},"end":{"line":28,"column":27}},"17":{"start":{"line":33,"column":0},"end":{"line":48,"column":1}},"18":{"start":{"line":35,"column":1},"end":{"line":47,"column":4}},"19":{"start":{"line":40,"column":4},"end":{"line":46,"column":5}},"20":{"start":{"line":41,"column":6},"end":{"line":41,"column":74}},"21":{"start":{"line":43,"column":6},"end":{"line":45,"column":9}},"22":{"start":{"line":44,"column":8},"end":{"line":44,"column":20}},"23":{"start":{"line":50,"column":0},"end":{"line":50,"column":23}}},"branchMap":{"1":{"line":11,"type":"if","locations":[{"start":{"line":11,"column":4},"end":{"line":11,"column":4}},{"start":{"line":11,"column":4},"end":{"line":11,"column":4}}]},"2":{"line":11,"type":"binary-expr","locations":[{"start":{"line":11,"column":8},"end":{"line":11,"column":13}},{"start":{"line":11,"column":16},"end":{"line":11,"column":23}}]},"3":{"line":12,"type":"binary-expr","locations":[{"start":{"line":12,"column":15},"end":{"line":12,"column":20}},{"start":{"line":12,"column":24},"end":{"line":12,"column":62}}]},"4":{"line":24,"type":"if","locations":[{"start":{"line":24,"column":4},"end":{"line":24,"column":4}},{"start":{"line":24,"column":4},"end":{"line":24,"column":4}}]},"5":{"line":24,"type":"binary-expr","locations":[{"start":{"line":24,"column":8},"end":{"line":24,"column":13}},{"start":{"line":24,"column":17},"end":{"line":24,"column":23}}]},"6":{"line":26,"type":"binary-expr","locations":[{"start":{"line":26,"column":15},"end":{"line":26,"column":20}},{"start":{"line":26,"column":24},"end":{"line":26,"column":52}}]},"7":{"line":40,"type":"if","locations":[{"start":{"line":40,"column":4},"end":{"line":40,"column":4}},{"start":{"line":40,"column":4},"end":{"line":40,"column":4}}]},"8":{"line":40,"type":"binary-expr","locations":[{"start":{"line":40,"column":8},"end":{"line":40,"column":13}},{"start":{"line":40,"column":17},"end":{"line":40,"column":24}}]},"9":{"line":41,"type":"binary-expr","locations":[{"start":{"line":41,"column":15},"end":{"line":41,"column":20}},{"start":{"line":41,"column":24},"end":{"line":41,"column":62}}]}}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/rentals.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/rentals.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1},"b":{},"f":{},"fnMap":{},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}},"3":{"start":{"line":3,"column":0},"end":{"line":3,"column":50}},"4":{"start":{"line":5,"column":0},"end":{"line":5,"column":52}},"5":{"start":{"line":6,"column":0},"end":{"line":6,"column":44}},"6":{"start":{"line":7,"column":0},"end":{"line":7,"column":63}},"7":{"start":{"line":9,"column":0},"end":{"line":9,"column":74}},"8":{"start":{"line":12,"column":0},"end":{"line":12,"column":54}},"9":{"start":{"line":17,"column":0},"end":{"line":17,"column":24}}},"branchMap":{}},"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/rentals.js":{"path":"/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/rentals.js","s":{"1":1,"2":1,"3":1,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":1},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0},"fnMap":{"1":{"name":"(anonymous_1)","line":5,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":32}}},"2":{"name":"(anonymous_2)","line":6,"loc":{"start":{"line":6,"column":36},"end":{"line":6,"column":59}}},"3":{"name":"(anonymous_3)","line":11,"loc":{"start":{"line":11,"column":41},"end":{"line":11,"column":70}}},"4":{"name":"(anonymous_4)","line":26,"loc":{"start":{"line":26,"column":22},"end":{"line":26,"column":41}}},"5":{"name":"(anonymous_5)","line":27,"loc":{"start":{"line":27,"column":41},"end":{"line":27,"column":70}}},"6":{"name":"(anonymous_6)","line":37,"loc":{"start":{"line":37,"column":21},"end":{"line":37,"column":46}}},"7":{"name":"(anonymous_7)","line":38,"loc":{"start":{"line":38,"column":62},"end":{"line":38,"column":91}}},"8":{"name":"(anonymous_8)","line":48,"loc":{"start":{"line":48,"column":19},"end":{"line":48,"column":38}}},"9":{"name":"(anonymous_9)","line":49,"loc":{"start":{"line":49,"column":34},"end":{"line":49,"column":60}}},"10":{"name":"(anonymous_10)","line":60,"loc":{"start":{"line":60,"column":20},"end":{"line":60,"column":39}}},"11":{"name":"(anonymous_11)","line":61,"loc":{"start":{"line":61,"column":20},"end":{"line":61,"column":46}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":46}},"3":{"start":{"line":4,"column":0},"end":{"line":70,"column":1}},"4":{"start":{"line":6,"column":2},"end":{"line":23,"column":4}},"5":{"start":{"line":7,"column":3},"end":{"line":21,"column":4}},"6":{"start":{"line":8,"column":4},"end":{"line":8,"column":41}},"7":{"start":{"line":9,"column":4},"end":{"line":9,"column":21}},"8":{"start":{"line":11,"column":4},"end":{"line":20,"column":6}},"9":{"start":{"line":12,"column":5},"end":{"line":18,"column":6}},"10":{"start":{"line":19,"column":5},"end":{"line":19,"column":26}},"11":{"start":{"line":27,"column":3},"end":{"line":34,"column":4}},"12":{"start":{"line":28,"column":3},"end":{"line":33,"column":4}},"13":{"start":{"line":29,"column":4},"end":{"line":29,"column":61}},"14":{"start":{"line":30,"column":4},"end":{"line":30,"column":21}},"15":{"start":{"line":32,"column":5},"end":{"line":32,"column":26}},"16":{"start":{"line":38,"column":2},"end":{"line":45,"column":5}},"17":{"start":{"line":39,"column":3},"end":{"line":44,"column":4}},"18":{"start":{"line":40,"column":4},"end":{"line":40,"column":61}},"19":{"start":{"line":41,"column":4},"end":{"line":41,"column":21}},"20":{"start":{"line":43,"column":4},"end":{"line":43,"column":25}},"21":{"start":{"line":49,"column":2},"end":{"line":56,"column":5}},"22":{"start":{"line":50,"column":3},"end":{"line":55,"column":4}},"23":{"start":{"line":51,"column":4},"end":{"line":51,"column":61}},"24":{"start":{"line":52,"column":4},"end":{"line":52,"column":21}},"25":{"start":{"line":54,"column":4},"end":{"line":54,"column":22}},"26":{"start":{"line":61,"column":2},"end":{"line":68,"column":5}},"27":{"start":{"line":62,"column":3},"end":{"line":67,"column":4}},"28":{"start":{"line":63,"column":4},"end":{"line":63,"column":33}},"29":{"start":{"line":64,"column":4},"end":{"line":64,"column":21}},"30":{"start":{"line":66,"column":4},"end":{"line":66,"column":22}},"31":{"start":{"line":72,"column":0},"end":{"line":72,"column":34}}},"branchMap":{"1":{"line":7,"type":"if","locations":[{"start":{"line":7,"column":3},"end":{"line":7,"column":3}},{"start":{"line":7,"column":3},"end":{"line":7,"column":3}}]},"2":{"line":28,"type":"if","locations":[{"start":{"line":28,"column":3},"end":{"line":28,"column":3}},{"start":{"line":28,"column":3},"end":{"line":28,"column":3}}]},"3":{"line":39,"type":"if","locations":[{"start":{"line":39,"column":3},"end":{"line":39,"column":3}},{"start":{"line":39,"column":3},"end":{"line":39,"column":3}}]},"4":{"line":50,"type":"if","locations":[{"start":{"line":50,"column":3},"end":{"line":50,"column":3}},{"start":{"line":50,"column":3},"end":{"line":50,"column":3}}]},"5":{"line":62,"type":"if","locations":[{"start":{"line":62,"column":3},"end":{"line":62,"column":3}},{"start":{"line":62,"column":3},"end":{"line":62,"column":3}}]}}}} \ No newline at end of file diff --git a/coverage/lcov-report/VideoStoreAPI/app.js.html b/coverage/lcov-report/VideoStoreAPI/app.js.html deleted file mode 100644 index e796b5455..000000000 --- a/coverage/lcov-report/VideoStoreAPI/app.js.html +++ /dev/null @@ -1,308 +0,0 @@ - - - - Code coverage report for VideoStoreAPI/app.js - - - - - - - -
-
-

- all files / VideoStoreAPI/ app.js -

-
-
- 78.95% - Statements - 30/38 -
-
- 16.67% - Branches - 1/6 -
-
- 0% - Functions - 0/3 -
-
- 78.95% - Lines - 30/38 -
-
-
-
-

1 2 @@ -84,16 +84,16 @@

1×   1× -400× +200×     1× -2× -2× +1× +1×     -2× -400× +1× +200×       @@ -101,16 +101,16 @@

  1×   -  +1×         -  +1×     -  -  +1× +2×       @@ -136,18 +136,18 @@

}) };   -Customer.sort = function(column, p, n, callback) { +Customer.sort = function(column, p, n, callback) { // sort by column, for n number of records starting at p - db.customers.find({}, { + db.customers.find({}, { order: column, limit: n, offset: p - }, function(error, customers) { - if (error || !customers) { + }, function(error, customers) { + Iif (error || !customers) { callback(error || new Error("Could not retrieve customers"), undefined) } else { - callback(null, customers.map (function (customer) { - return customer + callback(null, customers.map (function (customer) { + return customer })) } }) @@ -160,7 +160,7 @@

diff --git a/coverage/lcov-report/VideoStoreAPI/models/index.html b/coverage/lcov-report/VideoStoreAPI/models/index.html index 37b711fb6..616207864 100644 --- a/coverage/lcov-report/VideoStoreAPI/models/index.html +++ b/coverage/lcov-report/VideoStoreAPI/models/index.html @@ -20,24 +20,24 @@

- 29.41% + 33.33% Statements - 30/102 + 34/102
- 5.77% + 11.54% Branches - 3/52 + 6/52
- 11.43% + 20% Functions - 4/35 + 7/35
- 29.41% + 33.33% Lines - 30/102 + 34/102
@@ -59,16 +59,16 @@

customers_model.js
64.71%11/1725%3/1257.14%4/764.71%11/17customers_model.js
88.24%15/1750%6/12100%7/788.24%15/17
VideoStoreAPI/models/
29.41%30/1025.77%3/5211.43%4/3529.41%30/102
33.33%34/10211.54%6/5220%7/3533.33%34/102
- -
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -821× -1× -1× -1× -1× -1× -1× -1× -  -  -1× -  -  -  -  -1× -  -  -1× -  -  -  -1× -1× -  -  -  -1× -  -  -1× -1× -1× -1× -  -1× -1× -1× -1× -  -  -  -1× -1× -1× -1× -  -  -  -1× -  -  -  -  -  -  -  -  -  -1× -  -  -  -  -  -  -  -  -  -  -  -1× -  -  -  -  -  -  -  -  -1× - 
var express = require('express');
-var path = require('path');
-var favicon = require('serve-favicon');
-var logger = require('morgan');
-var cookieParser = require('cookie-parser');
-var bodyParser = require('body-parser');
-var massive = require("massive");
-var app = module.exports = express();
-//
-// var connectionString = "postgres://localhost/video_store"
-var connectionString = "postgres://localhost/video_store_" + app.get('env');
- 
-// connect to Massive and get the db instance. You can safely use the
-// convenience sync method here because its on app load
-// you can also use loadSync - it's an alias
-var massiveInstance = massive.connectSync({connectionString : connectionString})
- 
-// Set a reference to the massive instance on Express' app:
-app.set('db', massiveInstance);
- 
- 
-// view engine setup
-app.set('views', path.join(__dirname, 'views'));
-app.set('view engine', 'jade');
- 
-// uncomment after placing your favicon in /public
-//app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
-app.use(logger('dev'));
-// this will terminate the request with an error 400 if the POST body
-// doesn't contain valid json
-app.use(bodyParser.json());
-app.use(bodyParser.urlencoded({ extended: false }));
-app.use(cookieParser());
-app.use(express.static(path.join(__dirname, 'public')));
- 
-var routes    = require('./routes/index');
-var customers = require('./routes/customers');
-var movies    = require('./routes/movies');
-var rentals   = require('./routes/rentals');
- 
- 
- 
-app.use('/', routes);
-app.use('/customers', customers);
-app.use('/movies', movies);
-app.use('/rentals', rentals);
- 
- 
-// catch 404 and forward to error handler
-app.use(function(req, res, next) {
-  var err = new Error('Not Found');
-  err.status = 404;
-  next(err);
-});
- 
-// error handlers
- 
-// development error handler
-// will print stacktrace
-Iif (app.get('env') === 'development') {
-  app.use(function(err, req, res, next) {
-    res.status(err.status || 500);
-    res.render('error', {
-      message: err.message,
-      error: err
-    });
-  });
-}
- 
-// production error handler
-// no stacktraces leaked to user
-app.use(function(err, req, res, next) {
-  res.status(err.status || 500);
-  res.render('error', {
-    message: err.message,
-    error: {}
-  });
-});
- 
- 
-module.exports = app;
- 
-
- - - - - - - - diff --git a/coverage/lcov-report/VideoStoreAPI/controllers/customers.js.html b/coverage/lcov-report/VideoStoreAPI/controllers/customers.js.html deleted file mode 100644 index 07ccf4334..000000000 --- a/coverage/lcov-report/VideoStoreAPI/controllers/customers.js.html +++ /dev/null @@ -1,218 +0,0 @@ - - - - Code coverage report for VideoStoreAPI/controllers/customers.js - - - - - - - -
-
-

- all files / VideoStoreAPI/controllers/ customers.js -

-
-
- 16.67% - Statements - 4/24 -
-
- 0% - Branches - 0/8 -
-
- 0% - Functions - 0/8 -
-
- 16.67% - Lines - 4/24 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -521× -1× -  -  -1× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1× - 
var Customer = require("../models/customers_model");
-var Rental = require("../models/rentals_model");
- 
- 
-var CustomersController = {
-	getCustomers: function(req, res) {
-		Customer.all(function(error, customers) {
-			if(error) {
-				var err = new Error("Error retrieving account list;\n" + error.message);
-				err.status = 500;
-			} else {
-				res.json(customers)
-			}
-		})
-	},
-	// customer id, sort column, offest ?????
-	subsetCustomers: function(req, res) {
-		Customer.sort(req.params.column, req.query.p, req.query.n, function(error, data) {
-			if(error) {
-				var err = new Error("No such data");
-				err.status = 404;
-			} else {
-				res.json(data)
-			}
-		})
-	},
- 
-	// customer id, all rentals attached to customer id within data params
-	getCustomersCurrent: function(req, res) {
-		Rental.getCurrentRentals(req.params.customer_id, function(error, data) {
-			if(error) {
-				var err = new Error("No such data");
-				err.status = 404;
-			} else {
-				res.json(data)
-			}
-		})
-	},
- 
-	getCustomersHistory: function(req, res) {
-		Rental.getPastRentals(req.params.customer_id, function(error, data) {
-			if(error) {
-				var err = new Error("No such data");
-				err.status = 404;
-			} else {
-				res.json(data)
-			}
-		})
-	}
-}
-module.exports = CustomersController
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/VideoStoreAPI/controllers/index.html b/coverage/lcov-report/VideoStoreAPI/controllers/index.html deleted file mode 100644 index 9c01e9cec..000000000 --- a/coverage/lcov-report/VideoStoreAPI/controllers/index.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - Code coverage report for VideoStoreAPI/controllers/ - - - - - - - -
-
-

- all files VideoStoreAPI/controllers/ -

-
-
- 16.22% - Statements - 12/74 -
-
- 0% - Branches - 0/24 -
-
- 0% - Functions - 0/26 -
-
- 16.22% - Lines - 12/74 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
customers.js
16.67%4/240%0/80%0/816.67%4/24
movies.js
21.05%4/190%0/60%0/721.05%4/19
rentals.js
12.9%4/310%0/100%0/1112.9%4/31
-
-
- - - - - - - diff --git a/coverage/lcov-report/VideoStoreAPI/controllers/movies.js.html b/coverage/lcov-report/VideoStoreAPI/controllers/movies.js.html deleted file mode 100644 index 5e382a67b..000000000 --- a/coverage/lcov-report/VideoStoreAPI/controllers/movies.js.html +++ /dev/null @@ -1,200 +0,0 @@ - - - - Code coverage report for VideoStoreAPI/controllers/movies.js - - - - - - - -
-
-

- all files / VideoStoreAPI/controllers/ movies.js -

-
-
- 21.05% - Statements - 4/19 -
-
- 0% - Branches - 0/6 -
-
- 0% - Functions - 0/7 -
-
- 21.05% - Lines - 4/19 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -461× -1× -  -  -1× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1× - 
var Movie = require("../models/movies_model");
-var Rental = require("../models/rentals_model");
- 
- 
-MoviesController = {
-	getMovies: function(req, res) {
-		Movie.all(function(error, movies) {
-			if(error) {
-				var err = new Error("Error retrieving movie list;\n" + error.message);
-				err.status = 500;
-			} else {
-				res.json(movies)
-			}
-		})
-	},
- 
-	subsetMovies: function(req, res) {
-		Movie.sort(req.params.column, req.query.p, req.query.n, function(error, data) {
-			if(error) {
-				var err = new Error("No such data");
-				err.status = 404;
-			} else {
-				res.json(data)
-			}
- 
-		})
-	},
- 
-	getRentalsCustomers: function(req, res) {
-			Rental.getCustomers(req.params.title, function(error, checked_out) {
-			if(error) {
-				var err = new Error("No one has that movie checked out");
-				err.status = 404;
-			} else {
-					res.json(checked_out)
-			}
-		})
-	},
- 
-	getMoviesHistory: function(req, res) {
- 
-	}
-}
- 
-module.exports = MoviesController
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/VideoStoreAPI/controllers/rentals.js.html b/coverage/lcov-report/VideoStoreAPI/controllers/rentals.js.html deleted file mode 100644 index e2b9a1437..000000000 --- a/coverage/lcov-report/VideoStoreAPI/controllers/rentals.js.html +++ /dev/null @@ -1,281 +0,0 @@ - - - - Code coverage report for VideoStoreAPI/controllers/rentals.js - - - - - - - -
-
-

- all files / VideoStoreAPI/controllers/ rentals.js -

-
-
- 12.9% - Statements - 4/31 -
-
- 0% - Branches - 0/10 -
-
- 0% - Functions - 0/11 -
-
- 12.9% - Lines - 4/31 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -731× -1× -  -1× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1× - 
var Rental = require("../models/rentals_model");
-var Movie = require("../models/movies_model");
- 
-RentalsController = {
-	getRentals: function(req, res) {
-		Movie.findMovie(req.params.title, function(error, movie) {
-			if(error) {
-				var err = new Error("No such movie");
-				err.status = 404;
-			} else {
-				Rental.getCurrentlyCheckedOut(movie, function(error, checked_out) {
-					var return_data = {
-						title:movie.title,
-						overview:movie.overview,
-						release_date:movie.release_date,
-						total_inventory:movie.inventory,
-						available_copies:(parseInt(movie.inventory))-(parseInt(checked_out))
-					} 
-					res.json(return_data)
-				})
-			}
- 
-		})
-	},
- 
-	getRentalsCustomers: function(req, res) {
-			Rental.getCustomers(req.params.title, function(error, checked_out) {
-			if(error) {
-				var err = new Error("No one has that movie checked out");
-				err.status = 404;
-			} else {
-					res.json(checked_out)
-			}
-		})
-	},
- 
-	getRentalsCheckOut: function(req, res, next) {
-		Rental.getCheckout(req.params.title, req.params.customerid, function(error, checked_out) {
-			if(error) {
-				var err = new Error("No one has that movie checked out");
-				err.status = 404;
-			} else {
-				res.json(checked_out)
-			}
-		});
-	},
- 
-	getRentalsReturn: function(req, res) {
-		Rental.getReturn(req.params.id, function(error, returned) {
-			if(error) {
-				var err = new Error("No one has that movie checked out");
-				err.status = 404;
-			} else {
-				res.json(returned)
-			}
-		});
- 
-	},
- 
-	getRentalsOverdue: function(req, res) {
-		Rental.getOverdue(function(error, over_due) {
-			if(error) {
-				var err = new Error("Ooops");
-				err.status = 404;
-			} else {
-				res.json(over_due)
-			}
-		});
-	}
-}
- 
-module.exports = RentalsController
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/VideoStoreAPI/index.html b/coverage/lcov-report/VideoStoreAPI/index.html deleted file mode 100644 index 87f8abea6..000000000 --- a/coverage/lcov-report/VideoStoreAPI/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - Code coverage report for VideoStoreAPI/ - - - - - - - -
-
-

- all files VideoStoreAPI/ -

-
-
- 78.95% - Statements - 30/38 -
-
- 16.67% - Branches - 1/6 -
-
- 0% - Functions - 0/3 -
-
- 78.95% - Lines - 30/38 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
app.js
78.95%30/3816.67%1/60%0/378.95%30/38
-
-
- - - - - - - diff --git a/coverage/lcov-report/VideoStoreAPI/models/customers_model.js.html b/coverage/lcov-report/VideoStoreAPI/models/customers_model.js.html deleted file mode 100644 index f0e7295cb..000000000 --- a/coverage/lcov-report/VideoStoreAPI/models/customers_model.js.html +++ /dev/null @@ -1,176 +0,0 @@ - - - - Code coverage report for VideoStoreAPI/models/customers_model.js - - - - - - - -
-
-

- all files / VideoStoreAPI/models/ customers_model.js -

-
-
- 88.24% - Statements - 15/17 -
-
- 50% - Branches - 6/12 -
-
- 100% - Functions - 7/7 -
-
- 88.24% - Lines - 15/17 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -381× -1× -  -1× -200× -  -  -1× -1× -1× -  -  -1× -200× -  -  -  -  -  -1× -  -1× -  -  -  -  -1× -  -  -1× -2× -  -  -  -  -  -1× - 
var app = require("../app");
-var db = app.get("db");
- 
-var Customer = function(id) {
-  this.id = id;
-}
- 
-Customer.all = function(callback) {
-  db.customers.find(function(error, customers) {
-    Iif (error|| !customers) {
-      callback(error || new Error("Could not retrieve customers"), undefined);
-    } else {
-      callback(null, customers.map(function(customer) {
-        return new Customer(customer.id);
-      }))
-    };
-  })
-};
- 
-Customer.sort = function(column, p, n, callback) {
-  // sort by column, for n number of records starting at p
- db.customers.find({}, {
-    order: column,
-    limit: n,
-    offset: p
-  }, function(error, customers) {
-    Iif (error || !customers) {
-      callback(error || new Error("Could not retrieve customers"), undefined)
-    } else {
-      callback(null, customers.map (function (customer) {
-        return customer
-      }))
-    }
-  })
-}
- 
-module.exports = Customer;
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/VideoStoreAPI/models/index.html b/coverage/lcov-report/VideoStoreAPI/models/index.html deleted file mode 100644 index 616207864..000000000 --- a/coverage/lcov-report/VideoStoreAPI/models/index.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - Code coverage report for VideoStoreAPI/models/ - - - - - - - -
-
-

- all files VideoStoreAPI/models/ -

-
-
- 33.33% - Statements - 34/102 -
-
- 11.54% - Branches - 6/52 -
-
- 20% - Functions - 7/35 -
-
- 33.33% - Lines - 34/102 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
customers_model.js
88.24%15/1750%6/12100%7/788.24%15/17
movies_model.js
30.43%7/230%0/180%0/930.43%7/23
rentals_model.js
19.35%12/620%0/220%0/1919.35%12/62
-
-
- - - - - - - diff --git a/coverage/lcov-report/VideoStoreAPI/models/movies_model.js.html b/coverage/lcov-report/VideoStoreAPI/models/movies_model.js.html deleted file mode 100644 index e2494443f..000000000 --- a/coverage/lcov-report/VideoStoreAPI/models/movies_model.js.html +++ /dev/null @@ -1,215 +0,0 @@ - - - - Code coverage report for VideoStoreAPI/models/movies_model.js - - - - - - - -
-
-

- all files / VideoStoreAPI/models/ movies_model.js -

-
-
- 30.43% - Statements - 7/23 -
-
- 0% - Branches - 0/18 -
-
- 0% - Functions - 0/9 -
-
- 30.43% - Lines - 7/23 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -511× -1× -  -1× -  -  -  -  -1× -  -  -  -  -  -  -  -  -  -  -  -1× -  -  -  -  -  -  -  -  -  -  -  -1× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1× - 
var app = require("../app");
-var db = app.get("db");
- 
-var Movie = function(title, inventory) {
-  this.title = title;
-  this.inventory = inventory;
-}
- 
-Movie.all = function(callback) {
-  db.movies.find(function(error, movies) {
-    if (error|| !movies) {
-      callback(error || new Error("Could not retrieve movies"), undefined);
-    } else {
-      callback(null, movies.map(function(movie) {
-        return new Movie(movie.title);
-      }))
-    };
-  })
-};
- 
-Movie.findMovie = function(title, callback) {
-  db.movies.findOne({title: title}, function(error, movie) {
- 
-    if (error || !movie) {
- 
-      callback(error || new Error("Movie not found"), undefined);
-    } else {
-      callback(null, movie)
-    }
-  })
-};
- 
-Movie.sort = function(column, p, n, callback) {
-  // sort by column, for n number of records starting at p
- db.movies.find({}, {
-    order: column,
-    limit: n,
-    offset: p
-  }, function(error, movies) {
-    if (error || !movies) {
-      callback(error || new Error("Could not retrieve movies"), undefined)
-    } else {
-      callback(null, movies.map (function (movie) {
-        return movie
-      }))
-    }
-  })
-}
- 
-module.exports = Movie;
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/VideoStoreAPI/models/rentals_model.js.html b/coverage/lcov-report/VideoStoreAPI/models/rentals_model.js.html deleted file mode 100644 index 1dcf8ba93..000000000 --- a/coverage/lcov-report/VideoStoreAPI/models/rentals_model.js.html +++ /dev/null @@ -1,455 +0,0 @@ - - - - Code coverage report for VideoStoreAPI/models/rentals_model.js - - - - - - - -
-
-

- all files / VideoStoreAPI/models/ rentals_model.js -

-
-
- 19.35% - Statements - 12/62 -
-
- 0% - Branches - 0/22 -
-
- 0% - Functions - 0/19 -
-
- 19.35% - Lines - 12/62 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -1311× -1× -  -1× -  -  -  -  -  -  -  -  -  -1× -  -  -  -  -  -  -  -  -  -1× -  -  -  -  -  -  -  -  -  -1× -  -  -  -  -  -  -  -  -  -1× -  -  -  -  -  -  -  -  -  -1× -  -  -  -  -  -  -  -  -  -1× -  -  -  -  -  -  -  -  -  -1× -  -  -  -  -  -  -  -  -  -  -  -  -  -1× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1× - 
var app = require("../app");
-var db = app.get("db");
- 
-var Rental = function(movie_id, customer_id, created_date, due_date, returned = false, returned_date = null) {
-  this.movie_id = movie_id;
-  this.customer_id = customer_id;
-  this.created_date = created_date;
-  this.due_date = due_date;
-  this.returned = returned;
-  this.returned_date = returned_date;
- 
-};
- 
-Rental.getCheckedOut = function(title, callback) {
-  db.rentals.where("title=$1 AND returned=$2", [title, false], function(error, checked_out) {
-    if(error) {
-      callback(error, undefined);
-    } else {
-      callback(null, checked_out);
-    }
-  })
-}
- 
-Rental.getCurrentRentals = function(customer_id, callback) {
-  db.rentals.where("customer_id=$1 AND returned=$2", [customer_id, false], function(error, checked_out) {
-    if(error) {
-      callback(error, undefined);
-    } else {
-      callback(null, checked_out);
-    }
-  })
-}
- 
-Rental.getCurrentlyCheckedOut = function(movie, callback) {
-  db.rentals.count({movie_id: movie.id, returned: false}, function (error, count) {
-    if(error) {
-      callback(error);
-    } else {
-      callback(null, count);
-    }
-  })
-}
- 
-Rental.getPastRentals = function(customer_id, callback) {
-  db.run("SELECT customer_id, created_date, movie_id, returned_date FROM rentals WHERE customer_id=$1 AND returned=$2 ORDER BY returned_date ASC", [customer_id, true], function(error, past_rentals) {
-    if(error) {
-      callback(error, undefined);
-    } else {
-      callback(null, past_rentals);
-    }
-  })
-}
- 
-Rental.getCustomers = function(movie_title, callback) {
-  db.run("SELECT * FROM customers WHERE id=(SELECT customer_id FROM rentals WHERE movie_id=(SELECT id FROM movies WHERE title=$1) AND returned=false)", [movie_title], function(error, customers) {
-    if(error) {
-      callback(error, undefined);
-    } else {
-      callback(null, customers);
-    }
-  })
-}
- 
-Rental.getOverdue = function(callback) {
-  var now = new Date()
-  db.run("SELECT customers.name, movies.title, rentals.created_date, rentals.due_date FROM rentals INNER JOIN movies ON movies.id=rentals.movie_id INNER JOIN customers ON customers.id=rentals.customer_id WHERE rentals.returned=false AND rentals.due_date<$1", [now], function (error, overdues) {
-    if (error) {
-      callback(error, undefined);
-    }
-    callback(null, overdues);
-    });
-}
- 
-Rental.getReturn = function(rental_id, callback) {
-  db.rentals.update({
-    id: rental_id,
-    returned: true,
-    returned_date: new Date()
-    }, function(error, checked_out) {
-    if(error) {
-      callback(error, undefined);
-    } else {
-      callback(null, checked_out);
-    }
-  })
-}
- 
-Rental.getCheckout = function(movie_title, id, callback) {
-    // get movie id from movie table by title
-  db.movies.findOne({
-    title: movie_title
-    // call back with movie id
-  }, function (error, movie) {
-    if (error) {
-      return callback(error);
-    } else if (!movie) {
-      return callback(new Error("Movie not found"));
-    }
- 
-        // remove money from account
-      db.run("UPDATE customers SET account_credit=account_credit-2.0 WHERE id=$1;", [id], function (error, movie_id = movie, account_balance_update) {
-        if (error) {
-          return callback(error);
-        }
- 
-      // set date vars
-      var now = new Date();
-      var due = new Date(now);
-      due.setDate(due.getDate() + 7);
- 
-      // save new rental (nested inside find)
-      db.rentals.save({
-        movie_id: movie_id.id,
-        customer_id: id,
-        created_date: now,
-        due_date: due,
-        returned: false
-        // callback with rental info
-      }, function (error, rental) {
-        if (error) {
-          return callback(error);
-        }
-        // pass rental back to controller
-        return callback(null, rental);
-      });
-    });
-  });
-}
- 
-module.exports = Rental;
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/VideoStoreAPI/routes/customers.js.html b/coverage/lcov-report/VideoStoreAPI/routes/customers.js.html deleted file mode 100644 index fa6403162..000000000 --- a/coverage/lcov-report/VideoStoreAPI/routes/customers.js.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - Code coverage report for VideoStoreAPI/routes/customers.js - - - - - - - -
-
-

- all files / VideoStoreAPI/routes/ customers.js -

-
-
- 100% - Statements - 8/8 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 8/8 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -131× -1× -1× -  -  -1× -1× -1× -1× -  -  -1× - 
var express = require('express');
-var router = express.Router();
-var Controller = require('../controllers/customers')
- 
-// select all from db
-router.get('/', Controller.getCustomers)
-router.get('/sort/:column', Controller.subsetCustomers)
-router.get('/:customer_id/current', Controller.getCustomersCurrent)
-router.get('/:customer_id/history', Controller.getCustomersHistory)
- 
- 
-module.exports = router;
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/VideoStoreAPI/routes/index.html b/coverage/lcov-report/VideoStoreAPI/routes/index.html deleted file mode 100644 index 0467dd39f..000000000 --- a/coverage/lcov-report/VideoStoreAPI/routes/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for VideoStoreAPI/routes/ - - - - - - - -
-
-

- all files VideoStoreAPI/routes/ -

-
-
- 93.75% - Statements - 30/32 -
-
- 100% - Branches - 0/0 -
-
- 0% - Functions - 0/2 -
-
- 93.75% - Lines - 30/32 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
customers.js
100%8/8100%0/0100%0/0100%8/8
index.js
71.43%5/7100%0/00%0/271.43%5/7
movies.js
100%8/8100%0/0100%0/0100%8/8
rentals.js
100%9/9100%0/0100%0/0100%9/9
-
-
- - - - - - - diff --git a/coverage/lcov-report/VideoStoreAPI/routes/index.js.html b/coverage/lcov-report/VideoStoreAPI/routes/index.js.html deleted file mode 100644 index 7c0bca040..000000000 --- a/coverage/lcov-report/VideoStoreAPI/routes/index.js.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - Code coverage report for VideoStoreAPI/routes/index.js - - - - - - - -
-
-

- all files / VideoStoreAPI/routes/ index.js -

-
-
- 71.43% - Statements - 5/7 -
-
- 100% - Branches - 0/0 -
-
- 0% - Functions - 0/2 -
-
- 71.43% - Lines - 5/7 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -151× -1× -  -  -  -1× -  -  -  -1× -  -  -  -1× - 
var express = require('express');
-var router = express.Router();
-// var Controller = require('../controllers/scrabble')
- 
-/* GET home page. */
-router.get('/', function(req, res, next) {
-  res.status(200).json({index: 'index'})
-});
- 
-router.get('/zomg', function(req, res, next) {
-  res.status(200).json({whatevs: 'it works!!!!'})
-});
- 
-module.exports = router;
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/VideoStoreAPI/routes/movies.js.html b/coverage/lcov-report/VideoStoreAPI/routes/movies.js.html deleted file mode 100644 index a17562bf1..000000000 --- a/coverage/lcov-report/VideoStoreAPI/routes/movies.js.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - Code coverage report for VideoStoreAPI/routes/movies.js - - - - - - - -
-
-

- all files / VideoStoreAPI/routes/ movies.js -

-
-
- 100% - Statements - 8/8 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 8/8 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -131× -1× -1× -  -  -1× -1× -1× -1× -  -  -1× - 
var express = require('express');
-var router = express.Router();
-var Controller = require('../controllers/movies')
- 
- 
-router.get('/', Controller.getMovies)
-router.get('/sort/:column', Controller.subsetMovies)
-router.get('/:title/current', Controller.getRentalsCustomers)
-router.get('/:title/history', Controller.getMoviesHistory)
- 
- 
-module.exports = router;
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/VideoStoreAPI/routes/rentals.js.html b/coverage/lcov-report/VideoStoreAPI/routes/rentals.js.html deleted file mode 100644 index e0bbe2fd3..000000000 --- a/coverage/lcov-report/VideoStoreAPI/routes/rentals.js.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - Code coverage report for VideoStoreAPI/routes/rentals.js - - - - - - - -
-
-

- all files / VideoStoreAPI/routes/ rentals.js -

-
-
- 100% - Statements - 9/9 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 9/9 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -181× -1× -1× -  -1× -1× -1× -  -1× -  -  -1× -  -  -  -  -1× - 
var express = require('express');
-var router = express.Router();
-var Controller = require('../controllers/rentals')
- 
-router.get('/overdue', Controller.getRentalsOverdue)
-router.get('/:title', Controller.getRentals)
-router.get('/:title/customers', Controller.getRentalsCustomers)
-// can't post from browser URL
-router.get('/:title/check-out/:customerid', Controller.getRentalsCheckOut)
-// must pass rental id, sorry....
-// passing movie titles is UNRELIABLE!
-router.get('/return/:id', Controller.getRentalsReturn)
- 
- 
- 
- 
-module.exports = router;
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/base.css b/coverage/lcov-report/base.css deleted file mode 100644 index 29737bcb0..000000000 --- a/coverage/lcov-report/base.css +++ /dev/null @@ -1,213 +0,0 @@ -body, html { - margin:0; padding: 0; - height: 100%; -} -body { - font-family: Helvetica Neue, Helvetica, Arial; - font-size: 14px; - color:#333; -} -.small { font-size: 12px; } -*, *:after, *:before { - -webkit-box-sizing:border-box; - -moz-box-sizing:border-box; - box-sizing:border-box; - } -h1 { font-size: 20px; margin: 0;} -h2 { font-size: 14px; } -pre { - font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; - margin: 0; - padding: 0; - -moz-tab-size: 2; - -o-tab-size: 2; - tab-size: 2; -} -a { color:#0074D9; text-decoration:none; } -a:hover { text-decoration:underline; } -.strong { font-weight: bold; } -.space-top1 { padding: 10px 0 0 0; } -.pad2y { padding: 20px 0; } -.pad1y { padding: 10px 0; } -.pad2x { padding: 0 20px; } -.pad2 { padding: 20px; } -.pad1 { padding: 10px; } -.space-left2 { padding-left:55px; } -.space-right2 { padding-right:20px; } -.center { text-align:center; } -.clearfix { display:block; } -.clearfix:after { - content:''; - display:block; - height:0; - clear:both; - visibility:hidden; - } -.fl { float: left; } -@media only screen and (max-width:640px) { - .col3 { width:100%; max-width:100%; } - .hide-mobile { display:none!important; } -} - -.quiet { - color: #7f7f7f; - color: rgba(0,0,0,0.5); -} -.quiet a { opacity: 0.7; } - -.fraction { - font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; - font-size: 10px; - color: #555; - background: #E8E8E8; - padding: 4px 5px; - border-radius: 3px; - vertical-align: middle; -} - -div.path a:link, div.path a:visited { color: #333; } -table.coverage { - border-collapse: collapse; - margin: 10px 0 0 0; - padding: 0; -} - -table.coverage td { - margin: 0; - padding: 0; - vertical-align: top; -} -table.coverage td.line-count { - text-align: right; - padding: 0 5px 0 20px; -} -table.coverage td.line-coverage { - text-align: right; - padding-right: 10px; - min-width:20px; -} - -table.coverage td span.cline-any { - display: inline-block; - padding: 0 5px; - width: 100%; -} -.missing-if-branch { - display: inline-block; - margin-right: 5px; - border-radius: 3px; - position: relative; - padding: 0 4px; - background: #333; - color: yellow; -} - -.skip-if-branch { - display: none; - margin-right: 10px; - position: relative; - padding: 0 4px; - background: #ccc; - color: white; -} -.missing-if-branch .typ, .skip-if-branch .typ { - color: inherit !important; -} -.coverage-summary { - border-collapse: collapse; - width: 100%; -} -.coverage-summary tr { border-bottom: 1px solid #bbb; } -.keyline-all { border: 1px solid #ddd; } -.coverage-summary td, .coverage-summary th { padding: 10px; } -.coverage-summary tbody { border: 1px solid #bbb; } -.coverage-summary td { border-right: 1px solid #bbb; } -.coverage-summary td:last-child { border-right: none; } -.coverage-summary th { - text-align: left; - font-weight: normal; - white-space: nowrap; -} -.coverage-summary th.file { border-right: none !important; } -.coverage-summary th.pct { } -.coverage-summary th.pic, -.coverage-summary th.abs, -.coverage-summary td.pct, -.coverage-summary td.abs { text-align: right; } -.coverage-summary td.file { white-space: nowrap; } -.coverage-summary td.pic { min-width: 120px !important; } -.coverage-summary tfoot td { } - -.coverage-summary .sorter { - height: 10px; - width: 7px; - display: inline-block; - margin-left: 0.5em; - background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; -} -.coverage-summary .sorted .sorter { - background-position: 0 -20px; -} -.coverage-summary .sorted-desc .sorter { - background-position: 0 -10px; -} -.status-line { height: 10px; } -/* dark red */ -.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } -.low .chart { border:1px solid #C21F39 } -/* medium red */ -.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } -/* light red */ -.low, .cline-no { background:#FCE1E5 } -/* light green */ -.high, .cline-yes { background:rgb(230,245,208) } -/* medium green */ -.cstat-yes { background:rgb(161,215,106) } -/* dark green */ -.status-line.high, .high .cover-fill { background:rgb(77,146,33) } -.high .chart { border:1px solid rgb(77,146,33) } -/* dark yellow (gold) */ -.medium .chart { border:1px solid #f9cd0b; } -.status-line.medium, .medium .cover-fill { background: #f9cd0b; } -/* light yellow */ -.medium { background: #fff4c2; } -/* light gray */ -span.cline-neutral { background: #eaeaea; } - -.cbranch-no { background: yellow !important; color: #111; } - -.cstat-skip { background: #ddd; color: #111; } -.fstat-skip { background: #ddd; color: #111 !important; } -.cbranch-skip { background: #ddd !important; color: #111; } - - -.cover-fill, .cover-empty { - display:inline-block; - height: 12px; -} -.chart { - line-height: 0; -} -.cover-empty { - background: white; -} -.cover-full { - border-right: none !important; -} -pre.prettyprint { - border: none !important; - padding: 0 !important; - margin: 0 !important; -} -.com { color: #999 !important; } -.ignore-none { color: #999; font-weight: normal; } - -.wrapper { - min-height: 100%; - height: auto !important; - height: 100%; - margin: 0 auto -48px; -} -.footer, .push { - height: 48px; -} diff --git a/coverage/lcov-report/index.html b/coverage/lcov-report/index.html deleted file mode 100644 index b0f5a2d78..000000000 --- a/coverage/lcov-report/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for All files - - - - - - - -
-
-

- / -

-
-
- 43.09% - Statements - 106/246 -
-
- 8.54% - Branches - 7/82 -
-
- 10.61% - Functions - 7/66 -
-
- 43.09% - Lines - 106/246 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
VideoStoreAPI/
78.95%30/3816.67%1/60%0/378.95%30/38
VideoStoreAPI/controllers/
16.22%12/740%0/240%0/2616.22%12/74
VideoStoreAPI/models/
33.33%34/10211.54%6/5220%7/3533.33%34/102
VideoStoreAPI/routes/
93.75%30/32100%0/00%0/293.75%30/32
-
-
- - - - - - - diff --git a/coverage/lcov-report/prettify.css b/coverage/lcov-report/prettify.css deleted file mode 100644 index b317a7cda..000000000 --- a/coverage/lcov-report/prettify.css +++ /dev/null @@ -1 +0,0 @@ -.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/coverage/lcov-report/prettify.js b/coverage/lcov-report/prettify.js deleted file mode 100644 index ef51e0386..000000000 --- a/coverage/lcov-report/prettify.js +++ /dev/null @@ -1 +0,0 @@ -window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/coverage/lcov-report/sort-arrow-sprite.png b/coverage/lcov-report/sort-arrow-sprite.png deleted file mode 100644 index 03f704a609c6fd0dbfdac63466a7d7c958b5cbf3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^>_9Bd!3HEZxJ@+%Qj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS>Jii$m5978H@?Fn+^JD|Y9yzj{W`447Gxa{7*dM7nnnD-Lb z6^}Hx2)'; - } - } - return cols; - } - // attaches a data attribute to every tr element with an object - // of data values keyed by column name - function loadRowData(tableRow) { - var tableCols = tableRow.querySelectorAll('td'), - colNode, - col, - data = {}, - i, - val; - for (i = 0; i < tableCols.length; i += 1) { - colNode = tableCols[i]; - col = cols[i]; - val = colNode.getAttribute('data-value'); - if (col.type === 'number') { - val = Number(val); - } - data[col.key] = val; - } - return data; - } - // loads all row data - function loadData() { - var rows = getTableBody().querySelectorAll('tr'), - i; - - for (i = 0; i < rows.length; i += 1) { - rows[i].data = loadRowData(rows[i]); - } - } - // sorts the table using the data for the ith column - function sortByIndex(index, desc) { - var key = cols[index].key, - sorter = function (a, b) { - a = a.data[key]; - b = b.data[key]; - return a < b ? -1 : a > b ? 1 : 0; - }, - finalSorter = sorter, - tableBody = document.querySelector('.coverage-summary tbody'), - rowNodes = tableBody.querySelectorAll('tr'), - rows = [], - i; - - if (desc) { - finalSorter = function (a, b) { - return -1 * sorter(a, b); - }; - } - - for (i = 0; i < rowNodes.length; i += 1) { - rows.push(rowNodes[i]); - tableBody.removeChild(rowNodes[i]); - } - - rows.sort(finalSorter); - - for (i = 0; i < rows.length; i += 1) { - tableBody.appendChild(rows[i]); - } - } - // removes sort indicators for current column being sorted - function removeSortIndicators() { - var col = getNthColumn(currentSort.index), - cls = col.className; - - cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); - col.className = cls; - } - // adds sort indicators for current column being sorted - function addSortIndicators() { - getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted'; - } - // adds event listeners for all sorter widgets - function enableUI() { - var i, - el, - ithSorter = function ithSorter(i) { - var col = cols[i]; - - return function () { - var desc = col.defaultDescSort; - - if (currentSort.index === i) { - desc = !currentSort.desc; - } - sortByIndex(i, desc); - removeSortIndicators(); - currentSort.index = i; - currentSort.desc = desc; - addSortIndicators(); - }; - }; - for (i =0 ; i < cols.length; i += 1) { - if (cols[i].sortable) { - // add the click event handler on the th so users - // dont have to click on those tiny arrows - el = getNthColumn(i).querySelector('.sorter').parentElement; - if (el.addEventListener) { - el.addEventListener('click', ithSorter(i)); - } else { - el.attachEvent('onclick', ithSorter(i)); - } - } - } - } - // adds sorting functionality to the UI - return function () { - if (!getTable()) { - return; - } - cols = loadColumns(); - loadData(cols); - addSortIndicators(); - enableUI(); - }; -})(); - -window.addEventListener('load', addSorting); diff --git a/coverage/lcov.info b/coverage/lcov.info deleted file mode 100644 index 8484536e2..000000000 --- a/coverage/lcov.info +++ /dev/null @@ -1,559 +0,0 @@ -TN: -SF:/Users/leahpetersen/C5/projects/VideoStoreAPI/app.js -FN:50,(anonymous_1) -FN:61,(anonymous_2) -FN:72,(anonymous_3) -FNF:3 -FNH:0 -FNDA:0,(anonymous_1) -FNDA:0,(anonymous_2) -FNDA:0,(anonymous_3) -DA:1,1 -DA:2,1 -DA:3,1 -DA:4,1 -DA:5,1 -DA:6,1 -DA:7,1 -DA:8,1 -DA:11,1 -DA:16,1 -DA:19,1 -DA:23,1 -DA:24,1 -DA:28,1 -DA:31,1 -DA:32,1 -DA:33,1 -DA:34,1 -DA:36,1 -DA:37,1 -DA:38,1 -DA:39,1 -DA:43,1 -DA:44,1 -DA:45,1 -DA:46,1 -DA:50,1 -DA:51,0 -DA:52,0 -DA:53,0 -DA:60,1 -DA:61,0 -DA:62,0 -DA:63,0 -DA:72,1 -DA:73,0 -DA:74,0 -DA:81,1 -LF:38 -LH:30 -BRDA:60,1,0,0 -BRDA:60,1,1,1 -BRDA:62,2,0,0 -BRDA:62,2,1,0 -BRDA:73,3,0,0 -BRDA:73,3,1,0 -BRF:6 -BRH:1 -end_of_record -TN: -SF:/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/index.js -FN:6,(anonymous_1) -FN:10,(anonymous_2) -FNF:2 -FNH:0 -FNDA:0,(anonymous_1) -FNDA:0,(anonymous_2) -DA:1,1 -DA:2,1 -DA:6,1 -DA:7,0 -DA:10,1 -DA:11,0 -DA:14,1 -LF:7 -LH:5 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/customers.js -FNF:0 -FNH:0 -DA:1,1 -DA:2,1 -DA:3,1 -DA:6,1 -DA:7,1 -DA:8,1 -DA:9,1 -DA:12,1 -LF:8 -LH:8 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/customers.js -FN:6,(anonymous_1) -FN:7,(anonymous_2) -FN:17,(anonymous_3) -FN:18,(anonymous_4) -FN:29,(anonymous_5) -FN:30,(anonymous_6) -FN:40,(anonymous_7) -FN:41,(anonymous_8) -FNF:8 -FNH:0 -FNDA:0,(anonymous_1) -FNDA:0,(anonymous_2) -FNDA:0,(anonymous_3) -FNDA:0,(anonymous_4) -FNDA:0,(anonymous_5) -FNDA:0,(anonymous_6) -FNDA:0,(anonymous_7) -FNDA:0,(anonymous_8) -DA:1,1 -DA:2,1 -DA:5,1 -DA:7,0 -DA:8,0 -DA:9,0 -DA:10,0 -DA:12,0 -DA:18,0 -DA:19,0 -DA:20,0 -DA:21,0 -DA:23,0 -DA:30,0 -DA:31,0 -DA:32,0 -DA:33,0 -DA:35,0 -DA:41,0 -DA:42,0 -DA:43,0 -DA:44,0 -DA:46,0 -DA:51,1 -LF:24 -LH:4 -BRDA:8,1,0,0 -BRDA:8,1,1,0 -BRDA:19,2,0,0 -BRDA:19,2,1,0 -BRDA:31,3,0,0 -BRDA:31,3,1,0 -BRDA:42,4,0,0 -BRDA:42,4,1,0 -BRF:8 -BRH:0 -end_of_record -TN: -SF:/Users/leahpetersen/C5/projects/VideoStoreAPI/models/customers_model.js -FN:4,(anonymous_1) -FN:8,(anonymous_2) -FN:9,(anonymous_3) -FN:13,(anonymous_4) -FN:20,(anonymous_5) -FN:26,(anonymous_6) -FN:30,(anonymous_7) -FNF:7 -FNH:7 -FNDA:200,(anonymous_1) -FNDA:1,(anonymous_2) -FNDA:1,(anonymous_3) -FNDA:200,(anonymous_4) -FNDA:1,(anonymous_5) -FNDA:1,(anonymous_6) -FNDA:2,(anonymous_7) -DA:1,1 -DA:2,1 -DA:4,1 -DA:5,200 -DA:8,1 -DA:9,1 -DA:10,1 -DA:11,0 -DA:13,1 -DA:14,200 -DA:20,1 -DA:22,1 -DA:27,1 -DA:28,0 -DA:30,1 -DA:31,2 -DA:37,1 -LF:17 -LH:15 -BRDA:10,1,0,0 -BRDA:10,1,1,1 -BRDA:10,2,0,1 -BRDA:10,2,1,1 -BRDA:11,3,0,0 -BRDA:11,3,1,0 -BRDA:27,4,0,0 -BRDA:27,4,1,1 -BRDA:27,5,0,1 -BRDA:27,5,1,1 -BRDA:28,6,0,0 -BRDA:28,6,1,0 -BRF:12 -BRH:6 -end_of_record -TN: -SF:/Users/leahpetersen/C5/projects/VideoStoreAPI/models/rentals_model.js -FN:4,(anonymous_1) -FN:14,(anonymous_2) -FN:15,(anonymous_3) -FN:24,(anonymous_4) -FN:25,(anonymous_5) -FN:34,(anonymous_6) -FN:35,(anonymous_7) -FN:44,(anonymous_8) -FN:45,(anonymous_9) -FN:54,(anonymous_10) -FN:55,(anonymous_11) -FN:64,(anonymous_12) -FN:66,(anonymous_13) -FN:74,(anonymous_14) -FN:79,(anonymous_15) -FN:88,(anonymous_16) -FN:93,(anonymous_17) -FN:101,(anonymous_18) -FN:119,(anonymous_19) -FNF:19 -FNH:0 -FNDA:0,(anonymous_1) -FNDA:0,(anonymous_2) -FNDA:0,(anonymous_3) -FNDA:0,(anonymous_4) -FNDA:0,(anonymous_5) -FNDA:0,(anonymous_6) -FNDA:0,(anonymous_7) -FNDA:0,(anonymous_8) -FNDA:0,(anonymous_9) -FNDA:0,(anonymous_10) -FNDA:0,(anonymous_11) -FNDA:0,(anonymous_12) -FNDA:0,(anonymous_13) -FNDA:0,(anonymous_14) -FNDA:0,(anonymous_15) -FNDA:0,(anonymous_16) -FNDA:0,(anonymous_17) -FNDA:0,(anonymous_18) -FNDA:0,(anonymous_19) -DA:1,1 -DA:2,1 -DA:4,1 -DA:5,0 -DA:6,0 -DA:7,0 -DA:8,0 -DA:9,0 -DA:10,0 -DA:14,1 -DA:15,0 -DA:16,0 -DA:17,0 -DA:19,0 -DA:24,1 -DA:25,0 -DA:26,0 -DA:27,0 -DA:29,0 -DA:34,1 -DA:35,0 -DA:36,0 -DA:37,0 -DA:39,0 -DA:44,1 -DA:45,0 -DA:46,0 -DA:47,0 -DA:49,0 -DA:54,1 -DA:55,0 -DA:56,0 -DA:57,0 -DA:59,0 -DA:64,1 -DA:65,0 -DA:66,0 -DA:67,0 -DA:68,0 -DA:70,0 -DA:74,1 -DA:75,0 -DA:80,0 -DA:81,0 -DA:83,0 -DA:88,1 -DA:90,0 -DA:94,0 -DA:95,0 -DA:96,0 -DA:97,0 -DA:101,0 -DA:102,0 -DA:103,0 -DA:107,0 -DA:108,0 -DA:109,0 -DA:112,0 -DA:120,0 -DA:121,0 -DA:124,0 -DA:130,1 -LF:62 -LH:12 -BRDA:16,1,0,0 -BRDA:16,1,1,0 -BRDA:26,2,0,0 -BRDA:26,2,1,0 -BRDA:36,3,0,0 -BRDA:36,3,1,0 -BRDA:46,4,0,0 -BRDA:46,4,1,0 -BRDA:56,5,0,0 -BRDA:56,5,1,0 -BRDA:67,6,0,0 -BRDA:67,6,1,0 -BRDA:80,7,0,0 -BRDA:80,7,1,0 -BRDA:94,8,0,0 -BRDA:94,8,1,0 -BRDA:96,9,0,0 -BRDA:96,9,1,0 -BRDA:102,10,0,0 -BRDA:102,10,1,0 -BRDA:120,11,0,0 -BRDA:120,11,1,0 -BRF:22 -BRH:0 -end_of_record -TN: -SF:/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/movies.js -FNF:0 -FNH:0 -DA:1,1 -DA:2,1 -DA:3,1 -DA:6,1 -DA:7,1 -DA:8,1 -DA:9,1 -DA:12,1 -LF:8 -LH:8 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/movies.js -FN:6,(anonymous_1) -FN:7,(anonymous_2) -FN:17,(anonymous_3) -FN:18,(anonymous_4) -FN:29,(anonymous_5) -FN:30,(anonymous_6) -FN:40,(anonymous_7) -FNF:7 -FNH:0 -FNDA:0,(anonymous_1) -FNDA:0,(anonymous_2) -FNDA:0,(anonymous_3) -FNDA:0,(anonymous_4) -FNDA:0,(anonymous_5) -FNDA:0,(anonymous_6) -FNDA:0,(anonymous_7) -DA:1,1 -DA:2,1 -DA:5,1 -DA:7,0 -DA:8,0 -DA:9,0 -DA:10,0 -DA:12,0 -DA:18,0 -DA:19,0 -DA:20,0 -DA:21,0 -DA:23,0 -DA:30,0 -DA:31,0 -DA:32,0 -DA:33,0 -DA:35,0 -DA:45,1 -LF:19 -LH:4 -BRDA:8,1,0,0 -BRDA:8,1,1,0 -BRDA:19,2,0,0 -BRDA:19,2,1,0 -BRDA:31,3,0,0 -BRDA:31,3,1,0 -BRF:6 -BRH:0 -end_of_record -TN: -SF:/Users/leahpetersen/C5/projects/VideoStoreAPI/models/movies_model.js -FN:4,(anonymous_1) -FN:9,(anonymous_2) -FN:10,(anonymous_3) -FN:14,(anonymous_4) -FN:21,(anonymous_5) -FN:22,(anonymous_6) -FN:33,(anonymous_7) -FN:39,(anonymous_8) -FN:43,(anonymous_9) -FNF:9 -FNH:0 -FNDA:0,(anonymous_1) -FNDA:0,(anonymous_2) -FNDA:0,(anonymous_3) -FNDA:0,(anonymous_4) -FNDA:0,(anonymous_5) -FNDA:0,(anonymous_6) -FNDA:0,(anonymous_7) -FNDA:0,(anonymous_8) -FNDA:0,(anonymous_9) -DA:1,1 -DA:2,1 -DA:4,1 -DA:5,0 -DA:6,0 -DA:9,1 -DA:10,0 -DA:11,0 -DA:12,0 -DA:14,0 -DA:15,0 -DA:21,1 -DA:22,0 -DA:24,0 -DA:26,0 -DA:28,0 -DA:33,1 -DA:35,0 -DA:40,0 -DA:41,0 -DA:43,0 -DA:44,0 -DA:50,1 -LF:23 -LH:7 -BRDA:11,1,0,0 -BRDA:11,1,1,0 -BRDA:11,2,0,0 -BRDA:11,2,1,0 -BRDA:12,3,0,0 -BRDA:12,3,1,0 -BRDA:24,4,0,0 -BRDA:24,4,1,0 -BRDA:24,5,0,0 -BRDA:24,5,1,0 -BRDA:26,6,0,0 -BRDA:26,6,1,0 -BRDA:40,7,0,0 -BRDA:40,7,1,0 -BRDA:40,8,0,0 -BRDA:40,8,1,0 -BRDA:41,9,0,0 -BRDA:41,9,1,0 -BRF:18 -BRH:0 -end_of_record -TN: -SF:/Users/leahpetersen/C5/projects/VideoStoreAPI/routes/rentals.js -FNF:0 -FNH:0 -DA:1,1 -DA:2,1 -DA:3,1 -DA:5,1 -DA:6,1 -DA:7,1 -DA:9,1 -DA:12,1 -DA:17,1 -LF:9 -LH:9 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/leahpetersen/C5/projects/VideoStoreAPI/controllers/rentals.js -FN:5,(anonymous_1) -FN:6,(anonymous_2) -FN:11,(anonymous_3) -FN:26,(anonymous_4) -FN:27,(anonymous_5) -FN:37,(anonymous_6) -FN:38,(anonymous_7) -FN:48,(anonymous_8) -FN:49,(anonymous_9) -FN:60,(anonymous_10) -FN:61,(anonymous_11) -FNF:11 -FNH:0 -FNDA:0,(anonymous_1) -FNDA:0,(anonymous_2) -FNDA:0,(anonymous_3) -FNDA:0,(anonymous_4) -FNDA:0,(anonymous_5) -FNDA:0,(anonymous_6) -FNDA:0,(anonymous_7) -FNDA:0,(anonymous_8) -FNDA:0,(anonymous_9) -FNDA:0,(anonymous_10) -FNDA:0,(anonymous_11) -DA:1,1 -DA:2,1 -DA:4,1 -DA:6,0 -DA:7,0 -DA:8,0 -DA:9,0 -DA:11,0 -DA:12,0 -DA:19,0 -DA:27,0 -DA:28,0 -DA:29,0 -DA:30,0 -DA:32,0 -DA:38,0 -DA:39,0 -DA:40,0 -DA:41,0 -DA:43,0 -DA:49,0 -DA:50,0 -DA:51,0 -DA:52,0 -DA:54,0 -DA:61,0 -DA:62,0 -DA:63,0 -DA:64,0 -DA:66,0 -DA:72,1 -LF:31 -LH:4 -BRDA:7,1,0,0 -BRDA:7,1,1,0 -BRDA:28,2,0,0 -BRDA:28,2,1,0 -BRDA:39,3,0,0 -BRDA:39,3,1,0 -BRDA:50,4,0,0 -BRDA:50,4,1,0 -BRDA:62,5,0,0 -BRDA:62,5,1,0 -BRF:10 -BRH:0 -end_of_record From 106260f6ac88328974276b4865716111637570fa Mon Sep 17 00:00:00 2001 From: Leah Date: Thu, 23 Jun 2016 09:44:51 -0700 Subject: [PATCH 52/69] switched views to render ejs, added docs ejs, route and controller --- app.js | 8 ++++++-- controllers/docs.js | 21 +++++++++++++++++++++ routes/index.js | 8 +++++++- views/docs.ejs | 11 +++++++++++ 4 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 controllers/docs.js create mode 100644 views/docs.ejs diff --git a/app.js b/app.js index f8590815b..61f56ef59 100644 --- a/app.js +++ b/app.js @@ -6,7 +6,11 @@ var cookieParser = require('cookie-parser'); var bodyParser = require('body-parser'); var massive = require("massive"); var app = module.exports = express(); -// + +// view engine setup +// app.set('views', path.join(__dirname, 'views')); +// app.set('view engine', 'ejs'); + // var connectionString = "postgres://localhost/video_store" var connectionString = "postgres://localhost/video_store_" + app.get('env'); @@ -21,7 +25,7 @@ app.set('db', massiveInstance); // view engine setup app.set('views', path.join(__dirname, 'views')); -app.set('view engine', 'jade'); +app.set('view engine', 'ejs'); // uncomment after placing your favicon in /public //app.use(favicon(path.join(__dirname, 'public', 'favicon.ico'))); diff --git a/controllers/docs.js b/controllers/docs.js new file mode 100644 index 000000000..f9dd55231 --- /dev/null +++ b/controllers/docs.js @@ -0,0 +1,21 @@ +// var Customer = require("../models/customers_model"); +// var Rental = require("../models/rentals_model"); + + +var DocsController = { + getDocs: function(req, res) { + res.render('docs', { title: 'The Docs' }); + } + // getDocs: function(req, res) { + // Movie.all(function(error, docs) { + // if(error) { + // var err = new Error("Error retrieving movie list;\n" + error.message); + // err.status = 500; + // } else { + // res.json(docs) + // } + // }) + // } +} + +module.exports = DocsController diff --git a/routes/index.js b/routes/index.js index f8e421cee..34a318930 100644 --- a/routes/index.js +++ b/routes/index.js @@ -1,6 +1,12 @@ var express = require('express'); var router = express.Router(); -// var Controller = require('../controllers/scrabble') +var Controller = require('../controllers/docs') + +/* GET docs html page. */ +router.get('/api/docs', Controller.getDocs) + +/* GET docs json. */ +// router.get('/api/docs.json', Controller.getJsonDocs) /* GET home page. */ router.get('/', function(req, res, next) { diff --git a/views/docs.ejs b/views/docs.ejs new file mode 100644 index 000000000..1500071a7 --- /dev/null +++ b/views/docs.ejs @@ -0,0 +1,11 @@ + + + + <%= title %> + + + +

<%= title %>

+

Welcome to <%= title %>

+ + \ No newline at end of file From 4c2b109e17a0f6696bbb5459667cb05e97a35ae4 Mon Sep 17 00:00:00 2001 From: Leah Date: Thu, 23 Jun 2016 10:43:23 -0700 Subject: [PATCH 53/69] added json file, trying to find the best way to print it out in a view --- controllers/docs.js | 6 +++++- public/docs.json | 20 ++++++++++++++++++++ views/docs.ejs | 2 ++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 public/docs.json diff --git a/controllers/docs.js b/controllers/docs.js index f9dd55231..e380e2cb0 100644 --- a/controllers/docs.js +++ b/controllers/docs.js @@ -1,10 +1,14 @@ // var Customer = require("../models/customers_model"); // var Rental = require("../models/rentals_model"); + var json = require('../public/docs.json'); var DocsController = { getDocs: function(req, res) { - res.render('docs', { title: 'The Docs' }); + res.render('docs', { + title: 'The Docs', + list: JSON.stringify(json) + }); } // getDocs: function(req, res) { // Movie.all(function(error, docs) { diff --git a/public/docs.json b/public/docs.json new file mode 100644 index 000000000..91f9c1814 --- /dev/null +++ b/public/docs.json @@ -0,0 +1,20 @@ + +{"/movies": { + "verb": "get", + "optional parameters": "insert", + "required parameters": "insert", + "description of use": "insert", + "if some data is found": "insert", + "if no data is found": "insert", + "if error occuered": "insert" + }, +"/customers": { + "verb": "get", + "optional parameters": "insert", + "required parameters": "insert", + "description of use": "insert", + "if some data is found": "insert", + "if no data is found": "insert", + "if error occured": "insert" + } +} diff --git a/views/docs.ejs b/views/docs.ejs index 1500071a7..66f670115 100644 --- a/views/docs.ejs +++ b/views/docs.ejs @@ -3,9 +3,11 @@ <%= title %> +

<%= title %>

Welcome to <%= title %>

+
<%= list %>
\ No newline at end of file From 719963804378f999978eca06c0f4ef827f189f6b Mon Sep 17 00:00:00 2001 From: Leah Date: Thu, 23 Jun 2016 15:23:14 -0700 Subject: [PATCH 54/69] changed rentals model error handling to be error or no results --- controllers/customers.js | 2 +- models/rentals_model.js | 16 ++++++++-------- public/docs.json | 37 ++++++++++++++++++++++++++++++++----- 3 files changed, 41 insertions(+), 14 deletions(-) diff --git a/controllers/customers.js b/controllers/customers.js index 4deaf461d..aecb6f058 100644 --- a/controllers/customers.js +++ b/controllers/customers.js @@ -6,7 +6,7 @@ var CustomersController = { getCustomers: function(req, res) { Customer.all(function(error, customers) { if(error) { - var err = new Error("Error retrieving account list;\n" + error.message); + var err = new Error("Error retrieving data;\n" + error.message); err.status = 500; } else { res.json(customers) diff --git a/models/rentals_model.js b/models/rentals_model.js index 037eb740a..ddaebc30f 100644 --- a/models/rentals_model.js +++ b/models/rentals_model.js @@ -13,7 +13,7 @@ var Rental = function(movie_id, customer_id, created_date, due_date, returned = Rental.getCheckedOut = function(title, callback) { db.rentals.where("title=$1 AND returned=$2", [title, false], function(error, checked_out) { - if(error) { + if(error|| !rentals) { callback(error, undefined); } else { callback(null, checked_out); @@ -23,7 +23,7 @@ Rental.getCheckedOut = function(title, callback) { Rental.getCurrentRentals = function(customer_id, callback) { db.rentals.where("customer_id=$1 AND returned=$2", [customer_id, false], function(error, checked_out) { - if(error) { + if(error|| !rentals) { callback(error, undefined); } else { callback(null, checked_out); @@ -33,7 +33,7 @@ Rental.getCurrentRentals = function(customer_id, callback) { Rental.getCurrentlyCheckedOut = function(movie, callback) { db.rentals.count({movie_id: movie.id, returned: false}, function (error, count) { - if(error) { + if(error|| !rentals) { callback(error); } else { callback(null, count); @@ -43,8 +43,8 @@ Rental.getCurrentlyCheckedOut = function(movie, callback) { Rental.getPastRentals = function(customer_id, callback) { db.run("SELECT customer_id, created_date, movie_id, returned_date FROM rentals WHERE customer_id=$1 AND returned=$2 ORDER BY returned_date ASC", [customer_id, true], function(error, past_rentals) { - if(error) { - callback(error, undefined); + if(error|| !rentals) { + callback(error || new Error("No past rentals"), undefined); } else { callback(null, past_rentals); } @@ -53,7 +53,7 @@ Rental.getPastRentals = function(customer_id, callback) { Rental.getCustomers = function(movie_title, callback) { db.run("SELECT * FROM customers WHERE id=(SELECT customer_id FROM rentals WHERE movie_id=(SELECT id FROM movies WHERE title=$1) AND returned=false)", [movie_title], function(error, customers) { - if(error) { + if(error|| !rentals) { callback(error, undefined); } else { callback(null, customers); @@ -64,7 +64,7 @@ Rental.getCustomers = function(movie_title, callback) { Rental.getOverdue = function(callback) { var now = new Date() db.run("SELECT customers.name, movies.title, rentals.created_date, rentals.due_date FROM rentals INNER JOIN movies ON movies.id=rentals.movie_id INNER JOIN customers ON customers.id=rentals.customer_id WHERE rentals.returned=false AND rentals.due_date<$1", [now], function (error, overdues) { - if (error) { + if (error|| !rentals) { callback(error, undefined); } callback(null, overdues); @@ -77,7 +77,7 @@ Rental.getReturn = function(rental_id, callback) { returned: true, returned_date: new Date() }, function(error, checked_out) { - if(error) { + if(error|| !rentals) { callback(error, undefined); } else { callback(null, checked_out); diff --git a/public/docs.json b/public/docs.json index 91f9c1814..ab39599fa 100644 --- a/public/docs.json +++ b/public/docs.json @@ -1,20 +1,47 @@ - -{"/movies": { +{ +"/customers": { + "verb": "get", + "optional parameters": "none", + "required parameters": "none", + "description of use": "returns list of all customers ids", + "if some data is found": "json", + "if no data is found": "Could not retrieve customers error from model", + "if error occured": "Status 500 and Error retrieving data message from controller" + }, +"/customers/sort/:column": { + "verb": "get", + "optional parameters": "none", + "required parameters": "column, ?n=10&p=2: return n customer records, offset by p records", + "description of use": "retrieve subset of customers", + "if some data is found": "json", + "if no data is found": "Could not retrieve customers error from model", + "if error occured": "Status 500 and Error retrieving data message from controller" + }, +"/customers/:customer_id/current": { + "verb": "get", + "optional parameters": "none", + "required parameters": "customer id", + "description of use": "get list of current rentals for customer", + "if some data is found": "json data for rentals", + "if no data is found": "No current rentals message from model", + "if error occured": "No such data, 505" + }, +"/customers/:customer_id/history": { "verb": "get", "optional parameters": "insert", "required parameters": "insert", "description of use": "insert", "if some data is found": "insert", "if no data is found": "insert", - "if error occuered": "insert" + "if error occured": "insert" }, -"/customers": { +"/movies": { "verb": "get", "optional parameters": "insert", "required parameters": "insert", "description of use": "insert", "if some data is found": "insert", "if no data is found": "insert", - "if error occured": "insert" + "if error occuered": "insert" } } From dadc84721e8b696e6b25690bf88cd793ec297206 Mon Sep 17 00:00:00 2001 From: Leah Date: Thu, 23 Jun 2016 15:26:10 -0700 Subject: [PATCH 55/69] changed errors for no data found in db --- models/rentals_model.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/models/rentals_model.js b/models/rentals_model.js index ddaebc30f..7e63783f1 100644 --- a/models/rentals_model.js +++ b/models/rentals_model.js @@ -14,7 +14,7 @@ var Rental = function(movie_id, customer_id, created_date, due_date, returned = Rental.getCheckedOut = function(title, callback) { db.rentals.where("title=$1 AND returned=$2", [title, false], function(error, checked_out) { if(error|| !rentals) { - callback(error, undefined); + callback(error || new Error("No results from database"), undefined); } else { callback(null, checked_out); } @@ -24,7 +24,7 @@ Rental.getCheckedOut = function(title, callback) { Rental.getCurrentRentals = function(customer_id, callback) { db.rentals.where("customer_id=$1 AND returned=$2", [customer_id, false], function(error, checked_out) { if(error|| !rentals) { - callback(error, undefined); + callback(error || new Error("No results from database"), undefined); } else { callback(null, checked_out); } @@ -34,7 +34,7 @@ Rental.getCurrentRentals = function(customer_id, callback) { Rental.getCurrentlyCheckedOut = function(movie, callback) { db.rentals.count({movie_id: movie.id, returned: false}, function (error, count) { if(error|| !rentals) { - callback(error); + callback(error || new Error("No results from database"), undefined); } else { callback(null, count); } @@ -54,7 +54,7 @@ Rental.getPastRentals = function(customer_id, callback) { Rental.getCustomers = function(movie_title, callback) { db.run("SELECT * FROM customers WHERE id=(SELECT customer_id FROM rentals WHERE movie_id=(SELECT id FROM movies WHERE title=$1) AND returned=false)", [movie_title], function(error, customers) { if(error|| !rentals) { - callback(error, undefined); + callback(error || new Error("No results from database"), undefined); } else { callback(null, customers); } @@ -65,7 +65,7 @@ Rental.getOverdue = function(callback) { var now = new Date() db.run("SELECT customers.name, movies.title, rentals.created_date, rentals.due_date FROM rentals INNER JOIN movies ON movies.id=rentals.movie_id INNER JOIN customers ON customers.id=rentals.customer_id WHERE rentals.returned=false AND rentals.due_date<$1", [now], function (error, overdues) { if (error|| !rentals) { - callback(error, undefined); + callback(error || new Error("No results from database"), undefined); } callback(null, overdues); }); @@ -78,7 +78,7 @@ Rental.getReturn = function(rental_id, callback) { returned_date: new Date() }, function(error, checked_out) { if(error|| !rentals) { - callback(error, undefined); + callback(error || new Error("No results from database"), undefined); } else { callback(null, checked_out); } @@ -94,7 +94,7 @@ Rental.getCheckout = function(movie_title, id, callback) { if (error) { return callback(error); } else if (!movie) { - return callback(new Error("Movie not found")); + return callback(new Error("No results in database")); } // remove money from account From 383ddd9e6c72a6ad373e91178a1ee14c9213155e Mon Sep 17 00:00:00 2001 From: Leah Date: Thu, 23 Jun 2016 19:16:19 -0700 Subject: [PATCH 56/69] changed error handling in customers controller to specify 500 or404 --- controllers/customers.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/controllers/customers.js b/controllers/customers.js index aecb6f058..64b24ae8b 100644 --- a/controllers/customers.js +++ b/controllers/customers.js @@ -5,9 +5,10 @@ var Rental = require("../models/rentals_model"); var CustomersController = { getCustomers: function(req, res) { Customer.all(function(error, customers) { - if(error) { - var err = new Error("Error retrieving data;\n" + error.message); - err.status = 500; + if(error="Could not retrieve customers") { + res.status(404).send(error) + } else if (error) { + res.status(500).send(error) } else { res.json(customers) } @@ -16,9 +17,10 @@ var CustomersController = { // customer id, sort column, offest ????? subsetCustomers: function(req, res) { Customer.sort(req.params.column, req.query.p, req.query.n, function(error, data) { - if(error) { - var err = new Error("No such data"); - err.status = 404; + if(error="Could not retrieve customers") { + res.status(404).send(error) + } else if (error) { + res.status(500).send(error) } else { res.json(data) } From d838d4b6469d156f5f246243075d3d5b13cc9669 Mon Sep 17 00:00:00 2001 From: Leah Date: Thu, 23 Jun 2016 19:27:52 -0700 Subject: [PATCH 57/69] finished the rest of the error handling from the rentals model --- controllers/customers.js | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/controllers/customers.js b/controllers/customers.js index 64b24ae8b..7f957d750 100644 --- a/controllers/customers.js +++ b/controllers/customers.js @@ -8,7 +8,8 @@ var CustomersController = { if(error="Could not retrieve customers") { res.status(404).send(error) } else if (error) { - res.status(500).send(error) + var err = "Please try again" + res.status(500).send(err) } else { res.json(customers) } @@ -20,7 +21,8 @@ var CustomersController = { if(error="Could not retrieve customers") { res.status(404).send(error) } else if (error) { - res.status(500).send(error) + var err = "Please try again" + res.status(500).send(err) } else { res.json(data) } @@ -30,9 +32,11 @@ var CustomersController = { // customer id, all rentals attached to customer id within data params getCustomersCurrent: function(req, res) { Rental.getCurrentRentals(req.params.customer_id, function(error, data) { - if(error) { - var err = new Error("No such data"); - err.status = 404; + if(error="No results from database") { + res.status(404).send(error) + } else if (error) { + var err = "Please try again" + res.status(500).send(err) } else { res.json(data) } @@ -41,9 +45,11 @@ var CustomersController = { getCustomersHistory: function(req, res) { Rental.getPastRentals(req.params.customer_id, function(error, data) { - if(error) { - var err = new Error("No such data"); - err.status = 404; + if(error="No past rentals") { + res.status(404).send(error) + } else if (error) { + var err = "Please try again" + res.status(500).send(err) } else { res.json(data) } From d6d240abdb328f479dfc19fc1f0f1086c10cf90b Mon Sep 17 00:00:00 2001 From: Leah Date: Thu, 23 Jun 2016 19:28:13 -0700 Subject: [PATCH 58/69] finished the json docs for customers endpoint --- public/docs.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/public/docs.json b/public/docs.json index ab39599fa..b5a9fc572 100644 --- a/public/docs.json +++ b/public/docs.json @@ -5,7 +5,7 @@ "required parameters": "none", "description of use": "returns list of all customers ids", "if some data is found": "json", - "if no data is found": "Could not retrieve customers error from model", + "if no data is found": "404 & Could not retrieve customers error from model", "if error occured": "Status 500 and Error retrieving data message from controller" }, "/customers/sort/:column": { @@ -14,8 +14,8 @@ "required parameters": "column, ?n=10&p=2: return n customer records, offset by p records", "description of use": "retrieve subset of customers", "if some data is found": "json", - "if no data is found": "Could not retrieve customers error from model", - "if error occured": "Status 500 and Error retrieving data message from controller" + "if no data is found": "404 & Could not retrieve customers error from model", + "if error occured": "500 & Please try again" }, "/customers/:customer_id/current": { "verb": "get", @@ -23,17 +23,17 @@ "required parameters": "customer id", "description of use": "get list of current rentals for customer", "if some data is found": "json data for rentals", - "if no data is found": "No current rentals message from model", - "if error occured": "No such data, 505" + "if no data is found": "404 & No current rentals message from model", + "if error occured": "500 & Please try again" }, "/customers/:customer_id/history": { "verb": "get", - "optional parameters": "insert", - "required parameters": "insert", - "description of use": "insert", - "if some data is found": "insert", - "if no data is found": "insert", - "if error occured": "insert" + "optional parameters": "none", + "required parameters": "customer id", + "description of use": "get list of past rentals for customer", + "if some data is found": "json data for rentals", + "if no data is found": "404 & No past rentals", + "if error occured": "500 & Please try again" }, "/movies": { "verb": "get", From 367f88cb2772e0098065b7f8094e04701a5946d5 Mon Sep 17 00:00:00 2001 From: Leah Date: Thu, 23 Jun 2016 20:15:08 -0700 Subject: [PATCH 59/69] updated error handling for movies model when no data is found --- models/movies_model.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/movies_model.js b/models/movies_model.js index 0e14d81e7..aac37e796 100644 --- a/models/movies_model.js +++ b/models/movies_model.js @@ -23,7 +23,7 @@ Movie.findMovie = function(title, callback) { if (error || !movie) { - callback(error || new Error("Movie not found"), undefined); + callback(error || new Error("Could not retrieve movies"), undefined); } else { callback(null, movie) } From 2a6cc03cf8df5631860033d31ddb970c5f88ebf9 Mon Sep 17 00:00:00 2001 From: Leah Date: Thu, 23 Jun 2016 20:18:44 -0700 Subject: [PATCH 60/69] updated routes to handle for both no data and error 500 --- controllers/movies.js | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/controllers/movies.js b/controllers/movies.js index 704e39a04..e2b24b274 100644 --- a/controllers/movies.js +++ b/controllers/movies.js @@ -5,9 +5,11 @@ var Rental = require("../models/rentals_model"); MoviesController = { getMovies: function(req, res) { Movie.all(function(error, movies) { - if(error) { - var err = new Error("Error retrieving movie list;\n" + error.message); - err.status = 500; + if(error="Could not retrieve movies") { + res.status(404).send(error) + } else if (error) { + var err = "Please try again" + res.status(500).send(err) } else { res.json(movies) } @@ -16,9 +18,11 @@ MoviesController = { subsetMovies: function(req, res) { Movie.sort(req.params.column, req.query.p, req.query.n, function(error, data) { - if(error) { - var err = new Error("No such data"); - err.status = 404; + if(error="Could not retrieve movies") { + res.status(404).send(error) + } else if (error) { + var err = "Please try again" + res.status(500).send(err) } else { res.json(data) } @@ -28,9 +32,11 @@ MoviesController = { getRentalsCustomers: function(req, res) { Rental.getCustomers(req.params.title, function(error, checked_out) { - if(error) { - var err = new Error("No one has that movie checked out"); - err.status = 404; + if(error="Could not retrieve movies") { + res.status(404).send(error) + } else if (error) { + var err = "Please try again" + res.status(500).send(err) } else { res.json(checked_out) } From 60d6347b10740d2e90f7f8965538aad0f9f698f0 Mon Sep 17 00:00:00 2001 From: Leah Date: Thu, 23 Jun 2016 20:19:03 -0700 Subject: [PATCH 61/69] finished docs for /movies endpoint --- public/docs.json | 43 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/public/docs.json b/public/docs.json index b5a9fc572..2fa9ec2b7 100644 --- a/public/docs.json +++ b/public/docs.json @@ -10,8 +10,8 @@ }, "/customers/sort/:column": { "verb": "get", - "optional parameters": "none", - "required parameters": "column, ?n=10&p=2: return n customer records, offset by p records", + "optional parameters": "?n=10&p=2: return n customer records, offset by p records", + "required parameters": "column", "description of use": "retrieve subset of customers", "if some data is found": "json", "if no data is found": "404 & Could not retrieve customers error from model", @@ -37,11 +37,38 @@ }, "/movies": { "verb": "get", - "optional parameters": "insert", - "required parameters": "insert", - "description of use": "insert", - "if some data is found": "insert", - "if no data is found": "insert", - "if error occuered": "insert" + "optional parameters": "none", + "required parameters": "none", + "description of use": "returns a list of all movie titles", + "if some data is found": "json data for movies", + "if no data is found": "404 & Could not retrieve movies", + "if error occuered": "500 & Please try again" + }, +"/movies/sort/:column": { + "verb": "get", + "optional parameters": "?n=10&p=2: return n customer records, offset by p records", + "required parameters": "column", + "description of use": "retrieve a subset of movies", + "if some data is found": "json data", + "if no data is found": "404 & Could not retrieve movies", + "if error occuered": "500 & Please try again" + }, +"/movies/:title/current": { + "verb": "get", + "optional parameters": "none", + "required parameters": "title", + "description of use": "list of customers currently with a checked out copy of this movie", + "if some data is found": "json data", + "if no data is found": "404 & Could not retrieve movies", + "if error occuered": "500 & Please try again" + }, +"/movies/:title/history": { + "verb": "get", + "optional parameters": "none", + "required parameters": "title", + "description of use": "list of customers who have previously checked out this movie", + "if some data is found": "json data", + "if no data is found": "404 & Could not retrieve movies", + "if error occuered": "500 & Please try again" } } From 965f029aa7239b776437635e71c0f877e1d40cb1 Mon Sep 17 00:00:00 2001 From: Leah Date: Thu, 23 Jun 2016 20:57:35 -0700 Subject: [PATCH 62/69] added html formatting for docs view to iterate through json file and print ul for each endpoint --- controllers/docs.js | 14 ++------------ views/docs.ejs | 13 ++++++++++++- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/controllers/docs.js b/controllers/docs.js index e380e2cb0..a31eefbec 100644 --- a/controllers/docs.js +++ b/controllers/docs.js @@ -1,25 +1,15 @@ // var Customer = require("../models/customers_model"); // var Rental = require("../models/rentals_model"); - var json = require('../public/docs.json'); +var docs = require('../public/docs.json'); var DocsController = { getDocs: function(req, res) { res.render('docs', { title: 'The Docs', - list: JSON.stringify(json) + docs: docs }); } - // getDocs: function(req, res) { - // Movie.all(function(error, docs) { - // if(error) { - // var err = new Error("Error retrieving movie list;\n" + error.message); - // err.status = 500; - // } else { - // res.json(docs) - // } - // }) - // } } module.exports = DocsController diff --git a/views/docs.ejs b/views/docs.ejs index 66f670115..c655f0a17 100644 --- a/views/docs.ejs +++ b/views/docs.ejs @@ -8,6 +8,17 @@

<%= title %>

Welcome to <%= title %>

-
<%= list %>
+
    + <% for (var key in docs) { %> + <% var list = docs[key] %> +
  • <%= key %>
  • +
      + <% for (var field in list) { %> + <% var entry = list[field]; %> +
    • <%= field %>: <%= entry %>
    • + <% } %> +
    + <% } %> +
\ No newline at end of file From 62da41f9715df701af2bf83dd112a30429fb29c5 Mon Sep 17 00:00:00 2001 From: Leah Date: Thu, 23 Jun 2016 21:02:57 -0700 Subject: [PATCH 63/69] cleaned up commented out code and whitespace --- controllers/docs.js | 7 ++++--- controllers/movies.js | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/controllers/docs.js b/controllers/docs.js index a31eefbec..39eb02efe 100644 --- a/controllers/docs.js +++ b/controllers/docs.js @@ -1,14 +1,15 @@ -// var Customer = require("../models/customers_model"); -// var Rental = require("../models/rentals_model"); var docs = require('../public/docs.json'); - var DocsController = { getDocs: function(req, res) { res.render('docs', { title: 'The Docs', docs: docs }); + }, + + getJsonDocs: function(req, res) { + res.json(docs); } } diff --git a/controllers/movies.js b/controllers/movies.js index e2b24b274..2890eba19 100644 --- a/controllers/movies.js +++ b/controllers/movies.js @@ -26,7 +26,6 @@ MoviesController = { } else { res.json(data) } - }) }, From 148c82dfe20ec7a9ca537631214cace5af8e9e75 Mon Sep 17 00:00:00 2001 From: Leah Date: Thu, 23 Jun 2016 21:03:47 -0700 Subject: [PATCH 64/69] put .json route above view route to give higher priority --- routes/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/routes/index.js b/routes/index.js index 34a318930..312d4901f 100644 --- a/routes/index.js +++ b/routes/index.js @@ -2,11 +2,12 @@ var express = require('express'); var router = express.Router(); var Controller = require('../controllers/docs') +/* GET docs json. */ +router.get('/api/docs.json', Controller.getJsonDocs) + /* GET docs html page. */ router.get('/api/docs', Controller.getDocs) -/* GET docs json. */ -// router.get('/api/docs.json', Controller.getJsonDocs) /* GET home page. */ router.get('/', function(req, res, next) { From 43b6264e1b292c7d12b0b15bfa7a781337928a71 Mon Sep 17 00:00:00 2001 From: Leah Date: Thu, 23 Jun 2016 21:27:52 -0700 Subject: [PATCH 65/69] fixed incorrect variable names and made = == --- controllers/customers.js | 8 ++++---- controllers/movies.js | 6 +++--- models/movies_model.js | 2 -- models/rentals_model.js | 28 ++++++++++++++-------------- 4 files changed, 21 insertions(+), 23 deletions(-) diff --git a/controllers/customers.js b/controllers/customers.js index 7f957d750..cbab3dac4 100644 --- a/controllers/customers.js +++ b/controllers/customers.js @@ -5,7 +5,7 @@ var Rental = require("../models/rentals_model"); var CustomersController = { getCustomers: function(req, res) { Customer.all(function(error, customers) { - if(error="Could not retrieve customers") { + if(error=="Could not retrieve customers") { res.status(404).send(error) } else if (error) { var err = "Please try again" @@ -18,7 +18,7 @@ var CustomersController = { // customer id, sort column, offest ????? subsetCustomers: function(req, res) { Customer.sort(req.params.column, req.query.p, req.query.n, function(error, data) { - if(error="Could not retrieve customers") { + if(error=="Could not retrieve customers") { res.status(404).send(error) } else if (error) { var err = "Please try again" @@ -32,7 +32,7 @@ var CustomersController = { // customer id, all rentals attached to customer id within data params getCustomersCurrent: function(req, res) { Rental.getCurrentRentals(req.params.customer_id, function(error, data) { - if(error="No results from database") { + if(error=="No results from database") { res.status(404).send(error) } else if (error) { var err = "Please try again" @@ -45,7 +45,7 @@ var CustomersController = { getCustomersHistory: function(req, res) { Rental.getPastRentals(req.params.customer_id, function(error, data) { - if(error="No past rentals") { + if(error=="No past rentals") { res.status(404).send(error) } else if (error) { var err = "Please try again" diff --git a/controllers/movies.js b/controllers/movies.js index 2890eba19..c0e26c23a 100644 --- a/controllers/movies.js +++ b/controllers/movies.js @@ -5,7 +5,7 @@ var Rental = require("../models/rentals_model"); MoviesController = { getMovies: function(req, res) { Movie.all(function(error, movies) { - if(error="Could not retrieve movies") { + if(error=="Could not retrieve movies") { res.status(404).send(error) } else if (error) { var err = "Please try again" @@ -18,7 +18,7 @@ MoviesController = { subsetMovies: function(req, res) { Movie.sort(req.params.column, req.query.p, req.query.n, function(error, data) { - if(error="Could not retrieve movies") { + if(error=="Could not retrieve movies") { res.status(404).send(error) } else if (error) { var err = "Please try again" @@ -31,7 +31,7 @@ MoviesController = { getRentalsCustomers: function(req, res) { Rental.getCustomers(req.params.title, function(error, checked_out) { - if(error="Could not retrieve movies") { + if(error=="Could not retrieve movies") { res.status(404).send(error) } else if (error) { var err = "Please try again" diff --git a/models/movies_model.js b/models/movies_model.js index aac37e796..a956a9562 100644 --- a/models/movies_model.js +++ b/models/movies_model.js @@ -20,9 +20,7 @@ Movie.all = function(callback) { Movie.findMovie = function(title, callback) { db.movies.findOne({title: title}, function(error, movie) { - if (error || !movie) { - callback(error || new Error("Could not retrieve movies"), undefined); } else { callback(null, movie) diff --git a/models/rentals_model.js b/models/rentals_model.js index 7e63783f1..7e1edfa0d 100644 --- a/models/rentals_model.js +++ b/models/rentals_model.js @@ -13,8 +13,8 @@ var Rental = function(movie_id, customer_id, created_date, due_date, returned = Rental.getCheckedOut = function(title, callback) { db.rentals.where("title=$1 AND returned=$2", [title, false], function(error, checked_out) { - if(error|| !rentals) { - callback(error || new Error("No results from database"), undefined); + if(error|| !checked_out) { + return callback(error || new Error("No results from database"), undefined); } else { callback(null, checked_out); } @@ -23,8 +23,8 @@ Rental.getCheckedOut = function(title, callback) { Rental.getCurrentRentals = function(customer_id, callback) { db.rentals.where("customer_id=$1 AND returned=$2", [customer_id, false], function(error, checked_out) { - if(error|| !rentals) { - callback(error || new Error("No results from database"), undefined); + if(error|| !checked_out) { + return callback(error || new Error("No results from database"), undefined); } else { callback(null, checked_out); } @@ -33,8 +33,8 @@ Rental.getCurrentRentals = function(customer_id, callback) { Rental.getCurrentlyCheckedOut = function(movie, callback) { db.rentals.count({movie_id: movie.id, returned: false}, function (error, count) { - if(error|| !rentals) { - callback(error || new Error("No results from database"), undefined); + if(error|| !count) { + return callback(error || new Error("No results from database"), undefined); } else { callback(null, count); } @@ -43,8 +43,8 @@ Rental.getCurrentlyCheckedOut = function(movie, callback) { Rental.getPastRentals = function(customer_id, callback) { db.run("SELECT customer_id, created_date, movie_id, returned_date FROM rentals WHERE customer_id=$1 AND returned=$2 ORDER BY returned_date ASC", [customer_id, true], function(error, past_rentals) { - if(error|| !rentals) { - callback(error || new Error("No past rentals"), undefined); + if(error|| !past_rentals) { + return callback(error || new Error("No past rentals"), undefined); } else { callback(null, past_rentals); } @@ -53,8 +53,8 @@ Rental.getPastRentals = function(customer_id, callback) { Rental.getCustomers = function(movie_title, callback) { db.run("SELECT * FROM customers WHERE id=(SELECT customer_id FROM rentals WHERE movie_id=(SELECT id FROM movies WHERE title=$1) AND returned=false)", [movie_title], function(error, customers) { - if(error|| !rentals) { - callback(error || new Error("No results from database"), undefined); + if(error|| !customers) { + return callback(error || new Error("No results from database"), undefined); } else { callback(null, customers); } @@ -64,8 +64,8 @@ Rental.getCustomers = function(movie_title, callback) { Rental.getOverdue = function(callback) { var now = new Date() db.run("SELECT customers.name, movies.title, rentals.created_date, rentals.due_date FROM rentals INNER JOIN movies ON movies.id=rentals.movie_id INNER JOIN customers ON customers.id=rentals.customer_id WHERE rentals.returned=false AND rentals.due_date<$1", [now], function (error, overdues) { - if (error|| !rentals) { - callback(error || new Error("No results from database"), undefined); + if (error|| !overdues) { + return callback(error || new Error("No results from database"), undefined); } callback(null, overdues); }); @@ -77,8 +77,8 @@ Rental.getReturn = function(rental_id, callback) { returned: true, returned_date: new Date() }, function(error, checked_out) { - if(error|| !rentals) { - callback(error || new Error("No results from database"), undefined); + if(error|| !checked_out) { + return callback(error || new Error("No results from database"), undefined); } else { callback(null, checked_out); } From af2d10939941d8e1579c90ba62c1e801942824da Mon Sep 17 00:00:00 2001 From: Leah Date: Thu, 23 Jun 2016 21:30:32 -0700 Subject: [PATCH 66/69] added two tests to movies model spec, checking valid and invalid movie titles --- spec/models/movies_model.spec.js | 57 ++++++++++---------------------- 1 file changed, 17 insertions(+), 40 deletions(-) diff --git a/spec/models/movies_model.spec.js b/spec/models/movies_model.spec.js index 3013f1f56..a0b45f29f 100644 --- a/spec/models/movies_model.spec.js +++ b/spec/models/movies_model.spec.js @@ -1,44 +1,21 @@ var app = require("../../app"); var db = app.get("db"); -var Account = require('../../models/movies_model') +var Movie = require('../../models/movies_model') +describe('Movie', function () { + it('find valid movie', function (done) { + Movie.findMovie("Jaws", function(error, movie) { + expect(error).toBeNull; + expect(movie).toBeDefined; + done(); + }) + }) -// below are tests from in class demo - -// describe('Account', function () { -// var account1, account2 -// var initialBalance1 = 100.0 -// var initialBalance2 = 0 - -// beforeEach(function (done) { -// Account.create(initialBalance1, function(err, account) { -// account1 = account -// done() -// }) -// }) - -// afterEach(function () { -// // delete all the accounts I created - -// db.end() -// // Account.close_connection() -// }) - -// describe('#getBalance', function () { -// it('should return positive balances', function (done) { -// account1.getBalance(function (error, balance) { -// expect(error).toBeNull -// expect(balance).toEqual('$100.00') -// done() -// }) -// }) - -// it('should not break, I guess', function (done) { -// account1.getBalance(function (error, balance) { -// expect(error).toBeNull -// expect(balance).toEqual('$100.00') -// done() -// }) -// }) -// }) -// }) + it('find invalid movie', function (done) { + Movie.findMovie("Jawz", function(error, movie) { + expect(error).toBeDefined; + expect(movie).toBeUndefined; + done(); + }) + }) +}) From 955dace7715984d99f573a5430efd0fda4bde0d2 Mon Sep 17 00:00:00 2001 From: Alysia Brown Date: Fri, 24 Jun 2016 11:29:42 -0700 Subject: [PATCH 67/69] Controller tests finished. --- spec/controllers/customers.spec.js | 85 ++++++++++++++++- spec/controllers/movies.spec.js | 110 +++++++++++++++++++++- spec/controllers/rentals.spec.js | 145 ++++++++++++++++++++++++++++- 3 files changed, 332 insertions(+), 8 deletions(-) diff --git a/spec/controllers/customers.spec.js b/spec/controllers/customers.spec.js index 6e2f6fab0..7a206310a 100644 --- a/spec/controllers/customers.spec.js +++ b/spec/controllers/customers.spec.js @@ -23,14 +23,93 @@ describe("Endpoints under /customers", function() { var data = JSON.parse(body) expect(typeof data).toEqual('object') - for (var record of data) { - expect(Object.keys(record)).toEqual(['id']) - } + expect(Object.keys(data[0])).toEqual([ 'id' ]) done() }) }); +}); + +describe("Endpoints under /customers/sort/name", function() { + + it('responds with a 200 status code', function (done) { + request.get(base_url + route + "/sort/name", function(error, response, body) { + expect(response.statusCode).toEqual(200) + done() + }) + }); + + it("should be json", function(done) { + request.get(base_url + route + "/sort/name", function(error, response, body) { + expect(response.headers['content-type']).toContain('application/json') + done() + }) + }); + + it("should be an array of objects", function(done) { + request.get(base_url + route + "/sort/name", function(error, response, body) { + var data = JSON.parse(body) + expect(typeof data).toEqual('object') + + expect(Object.keys(data[0])).toEqual([ 'id', 'name', 'registered_at', 'address', 'city', 'state', 'postal_code', 'phone', 'account_credit' ]) + + done() + }) + }); +}); + +describe("Endpoints under /customers/:id/current", function() { + + it('responds with a 200 status code', function (done) { + request.get(base_url + route + "/5/current", function(error, response, body) { + expect(response.statusCode).toEqual(200) + done() + }) + }); + + it("should be json", function(done) { + request.get(base_url + route + "/5/current", function(error, response, body) { + expect(response.headers['content-type']).toContain('application/json') + done() + }) + }); + it("should be an array of objects", function(done) { + request.get(base_url + route + "/5/current", function(error, response, body) { + var data = JSON.parse(body) + expect(typeof data).toEqual('object') + expect(Object.keys(data[0])).toEqual([ 'id', 'movie_id', 'customer_id', 'created_date', 'due_date', 'returned', 'returned_date' ]) + done() + }) + }); +}); + +describe("Endpoints under /customers/:id/history", function() { + + it('responds with a 200 status code', function (done) { + request.get(base_url + route + "/5/history", function(error, response, body) { + expect(response.statusCode).toEqual(200) + done() + }) + }); + + it("should be json", function(done) { + request.get(base_url + route + "/5/history", function(error, response, body) { + expect(response.headers['content-type']).toContain('application/json') + done() + }) + }); + + it("should be an array of objects", function(done) { + request.get(base_url + route + "/5/history", function(error, response, body) { + var data = JSON.parse(body) + expect(typeof data).toEqual('object') + + expect(Object.keys(data[0])).toEqual([ 'customer_id', 'created_date', 'movie_id', 'returned_date' ]) + + done() + }) + }); }); diff --git a/spec/controllers/movies.spec.js b/spec/controllers/movies.spec.js index 73b5b4eff..b6bef7a10 100644 --- a/spec/controllers/movies.spec.js +++ b/spec/controllers/movies.spec.js @@ -4,10 +4,118 @@ var route = "movies/" describe("Endpoints under /movies", function() { + it('responds with a 200 status code', function (done) { request.get(base_url + route, function(error, response, body) { expect(response.statusCode).toEqual(200) done() }) }); -}); \ No newline at end of file + + it("should be json", function(done) { + request.get(base_url + route, function(error, response, body) { + expect(response.headers['content-type']).toContain('application/json') + done() + }) + }); + + it("should be an array of objects", function(done) { + request.get(base_url + route, function(error, response, body) { + var data = JSON.parse(body) + expect(typeof data).toEqual('object') + + expect(Object.keys(data[0])).toEqual([ 'title' ]) + + done() + }) + }); +}); + + +describe("Endpoints under /movies/sort/:column", function() { + + it('responds with a 200 status code', function (done) { + request.get(base_url + route + '/sort/title', function(error, response, body) { + expect(response.statusCode).toEqual(200) + done() + }) + }); + + it("should be json", function(done) { + request.get(base_url + route + '/sort/title', function(error, response, body) { + expect(response.headers['content-type']).toContain('application/json') + done() + }) + }); + + it("should be an array of objects", function(done) { + request.get(base_url + route + '/sort/title', function(error, response, body) { + var data = JSON.parse(body) + expect(typeof data).toEqual('object') + + expect(Object.keys(data[0])).toEqual([ 'id', 'title', 'overview', 'release_date', 'inventory' ]) + + done() + }) + }); + +}); + +describe("Endpoints under /movies/:title/current", function() { + + it('responds with a 200 status code', function (done) { + request.get(base_url + route + "/Jaws/current", function(error, response, body) { + expect(response.statusCode).toEqual(200) + done() + }) + }); + + it("should be json", function(done) { + request.get(base_url + route + "/Jaws/current", function(error, response, body) { + expect(response.headers['content-type']).toContain('application/json') + done() + }) + }); + + it("should be an array of objects", function(done) { + request.get(base_url + route + "/Jaws/current", function(error, response, body) { + var data = JSON.parse(body) + expect(typeof data).toEqual('object') + + expect(Object.keys(data[0])).toEqual([ 'id', 'name', 'registered_at', 'address', 'city', 'state', 'postal_code', 'phone', 'account_credit' ]) + + done() + }) + }); +}); + +// ******** history path tests are causing server timeouts. wtf?? ******** +// describe("Endpoints under /movies/:id/history", function() { +// +// it('responds with a 200 status code', function (done) { +// request.get(base_url + route + "/5/history", function(error, response, body) { +// expect(response.statusCode).toEqual(200) +// done() +// }) +// }); +// +// it("should be json", function(done) { +// request.get(base_url + route + "/5/history", function(error, response, body) { +// expect(response.headers['content-type']).toContain('application/json') +// done() +// }) +// }); +// +// it("should be an array of objects", function(done) { +// request.get(base_url + route + "/5/history", function(error, response, body) { +// var data = JSON.parse(body) +// expect(typeof data).toEqual('object') +// +// for (var record of data) { +// expect(Object.keys(data[0])).toEqual(['id']) +// } +// +// done() +// }) +// }); +// }); diff --git a/spec/controllers/rentals.spec.js b/spec/controllers/rentals.spec.js index 828753739..8d8fe57c2 100644 --- a/spec/controllers/rentals.spec.js +++ b/spec/controllers/rentals.spec.js @@ -3,11 +3,148 @@ var base_url = "http://localhost:3000/" var route = "rentals/" -describe("Endpoints under /rentals", function() { - it('/overdue responds with a 200 status code', function (done) { - request.get(base_url + route + "/overdue", function(error, response, body) { +describe("Endpoints under /overdue", function() { + + it('responds with a 200 status code', function (done) { + request.get(base_url + route + '/overdue', function(error, response, body) { + expect(response.statusCode).toEqual(200) + done() + }) + }); + + it("should be json", function(done) { + request.get(base_url + route + '/overdue', function(error, response, body) { + expect(response.headers['content-type']).toContain('application/json') + done() + }) + }); + + it("should be an array of objects", function(done) { + request.get(base_url + route + '/overdue', function(error, response, body) { + var data = JSON.parse(body) + expect(typeof data).toEqual('object') + + for (var record of data) { + expect(Object.keys(record)).toEqual([ 'name', 'title', 'created_date', 'due_date' ]) + } + + done() + }) + }); +}); + + +describe("Endpoints under /:title", function() { + + it('responds with a 200 status code', function (done) { + request.get(base_url + route + '/Jaws', function(error, response, body) { + expect(response.statusCode).toEqual(200) + done() + }) + }); + + it("should be json", function(done) { + request.get(base_url + route + '/Jaws', function(error, response, body) { + expect(response.headers['content-type']).toContain('application/json') + done() + }) + }); + + it("should be an array of objects", function(done) { + request.get(base_url + route + '/Jaws', function(error, response, body) { + var data = JSON.parse(body) + expect(typeof data).toEqual('object') + + expect(Object.keys(data)).toEqual([ 'title', 'overview', 'release_date', 'total_inventory', 'available_copies' ]) + + done() + }) + }); +}); + + +describe("Endpoints under /rentals/:title/customers", function() { + + it('responds with a 200 status code', function (done) { + request.get(base_url + route + "/Jaws/customers", function(error, response, body) { expect(response.statusCode).toEqual(200) done() }) }); -}); \ No newline at end of file + + it("should be json", function(done) { + request.get(base_url + route + "/Jaws/customers", function(error, response, body) { + expect(response.headers['content-type']).toContain('application/json') + done() + }) + }); + + it("should be an array of objects", function(done) { + request.get(base_url + route + "/Jaws/customers", function(error, response, body) { + var data = JSON.parse(body) + expect(typeof data).toEqual('object') + + for (var record of data) { + expect(Object.keys(record)).toEqual([ 'id', 'name', 'registered_at', 'address', 'city', 'state', 'postal_code', 'phone', 'account_credit' ]) + } + + done() + }) + }); +}); + +describe("Endpoints under /rentals/:title/check-out/:customer_id", function() { + + it('responds with a 200 status code', function (done) { + request.get(base_url + route + "/Jaws/check-out/5", function(error, response, body) { + expect(response.statusCode).toEqual(200) + done() + }) + }); + + it("should be json", function(done) { + request.get(base_url + route + "/Jaws/check-out/5", function(error, response, body) { + expect(response.headers['content-type']).toContain('application/json') + done() + }) + }); + + it("should be an array of objects", function(done) { + request.get(base_url + route + "/Jaws/check-out/5", function(error, response, body) { + var data = JSON.parse(body) + expect(typeof data).toEqual('object') + + expect(Object.keys(data)).toEqual([ 'id', 'movie_id', 'customer_id', 'created_date', 'due_date', 'returned', 'returned_date' ]) + + done() + }) + }); +}); + +describe("Endpoints under /rentals/return/:id", function() { + + it('responds with a 200 status code', function (done) { + request.get(base_url + route + "/return/5", function(error, response, body) { + expect(response.statusCode).toEqual(200) + done() + }) + }); + + it("should be json", function(done) { + request.get(base_url + route + "/return/5", function(error, response, body) { + expect(response.headers['content-type']).toContain('application/json') + done() + }) + }); + + it("should be an array of objects", function(done) { + request.get(base_url + route + "/return/5", function(error, response, body) { + var data = JSON.parse(body) + expect(typeof data).toEqual('object') + + expect(Object.keys(data)).toEqual([ 'id', 'movie_id', 'customer_id', 'created_date', 'due_date', 'returned', 'returned_date' ]) + + done() + }) + }); +}); From 4da180d4f5a326fd717eb80acb99e66893ef1f93 Mon Sep 17 00:00:00 2001 From: Alysia Brown Date: Fri, 24 Jun 2016 14:29:19 -0700 Subject: [PATCH 68/69] Added model tests. --- spec/models/customers_model.spec.js | 11 +- spec/models/movies_model.spec.js | 44 +++++++ spec/models/rentals_model.spec.js | 198 ++++++++++++++++++++++------ 3 files changed, 201 insertions(+), 52 deletions(-) diff --git a/spec/models/customers_model.spec.js b/spec/models/customers_model.spec.js index 2879ec874..bc02add34 100644 --- a/spec/models/customers_model.spec.js +++ b/spec/models/customers_model.spec.js @@ -4,8 +4,6 @@ var Customer = require('../../models/customers_model') -// describe('Customer', function () { - describe('#all', function () { it('should return an array of customers', function (done) { @@ -14,13 +12,6 @@ describe('#all', function () { done() }) }) - - // it('should return an array of customers', function (done) { - // Customer.all(function (error, data) { - // expect(typeof data).toEqual('array') - // done() - // }) - // }) }) describe('#sort', function () { @@ -31,4 +22,4 @@ describe('#sort', function () { done() }) }) -}) \ No newline at end of file +}) diff --git a/spec/models/movies_model.spec.js b/spec/models/movies_model.spec.js index a0b45f29f..8768eb8f0 100644 --- a/spec/models/movies_model.spec.js +++ b/spec/models/movies_model.spec.js @@ -18,4 +18,48 @@ describe('Movie', function () { done(); }) }) + + it('should return an array', function (done) { + Movie.all(function (error, movies) { + expect(movies).toEqual(jasmine.any(Array)) + done() + }) + }) + +}) + + + +describe('return all movies', function () { + it('should not be null', function (done) { + Movie.all(function (error, movies) { + expect(movies).toNotBe(null) + done() + }) + }) +}) + +describe('return sorted movies', function () { + it('not be null', function (done) { + Movie.findMovie("title", function(error, movie) { + expect(error).toBeNull; + expect(movie).toBeDefined; + done(); + }) + }) + + it('should contain movie objects', function (done) { + Movie.all(function (error, movies) { + expect(movies[0]).toEqual(jasmine.any(Movie)) + done() + }) + }) + + it('should contain all movies', function (done) { + Movie.all(function (error, movies) { + expect(movies.length).toEqual(100) + done() + }) + }) + }) diff --git a/spec/models/rentals_model.spec.js b/spec/models/rentals_model.spec.js index 7d2a62512..d7d3bf062 100644 --- a/spec/models/rentals_model.spec.js +++ b/spec/models/rentals_model.spec.js @@ -1,44 +1,158 @@ var app = require("../../app"); var db = app.get("db"); -var Account = require('../../models/rentals_model') - - -// below are tests from in class demo - -// describe('Account', function () { -// var account1, account2 -// var initialBalance1 = 100.0 -// var initialBalance2 = 0 - -// beforeEach(function (done) { -// Account.create(initialBalance1, function(err, account) { -// account1 = account -// done() -// }) -// }) - -// afterEach(function () { -// // delete all the accounts I created - -// db.end() -// // Account.close_connection() -// }) - -// describe('#getBalance', function () { -// it('should return positive balances', function (done) { -// account1.getBalance(function (error, balance) { -// expect(error).toBeNull -// expect(balance).toEqual('$100.00') -// done() -// }) -// }) - -// it('should not break, I guess', function (done) { -// account1.getBalance(function (error, balance) { -// expect(error).toBeNull -// expect(balance).toEqual('$100.00') -// done() -// }) -// }) -// }) -// }) +var Rental = require('../../models/rentals_model') + + +describe('Rental getCheckedOut', function () { + it('not be null', function (done) { + Rental.getCheckedOut("Jaws", function(error, rental) { + expect(error).toBeNull; + expect(rental).toBeDefined; + done(); + }) + }) + + it('will not find invalid rentals', function (done) { + Rental.getCheckedOut("Jawz", function(error, rental) { + expect(error).toBeDefined; + expect(rental).toBeUndefined; + done(); + }) + }) +}) + + + +describe('return current rentals`', function () { + it('should not be null', function (done) { + Rental.getCurrentRentals(5, function (error, rentals) { + expect(rentals).toNotBe(null) + done() + }) + }) + + it('will not find invalid customers', function (done) { + Rental.getCurrentRentals(333, function(error, rental) { + expect(error).toBeDefined; + expect(rental).toBeUndefined; + done(); + }) + }) +}) + +describe('return currently checked out movies', function () { + it('not be null', function (done) { + Rental.getCurrentlyCheckedOut("Jaws", function(error, movie) { + expect(error).toBeNull; + expect(movie).toBeDefined; + done(); + }) + }) + + it('will not find invalid movies`', function (done) { + Rental.getCurrentlyCheckedOut("aldkfaslkfj", function(error, rental) { + expect(error).toBeDefined; + expect(rental).toBeUndefined; + done(); + }) + }) +}) + +describe('return previously checked out movies', function () { + it('not be null', function (done) { + Rental.getPastRentals("Jaws", function(error, movie) { + expect(error).toBeNull; + expect(movie).toBeDefined; + done(); + }) + }) + + it('will not find invalid movies', function (done) { + Rental.getPastRentals("aldkfaslkfj", function(error, rental) { + expect(error).toBeDefined; + expect(rental).toBeUndefined; + done(); + }) + }) +}) + +describe('return previously checked out movies', function () { + it('not be null', function (done) { + Rental.getCustomers("Jaws", function(error, movie) { + expect(error).toBeNull; + expect(movie).toBeDefined; + done(); + }) + }) + + it('will not find invalid movies', function (done) { + Rental.getCustomers("aldkfaslkfj", function(error, rental) { + expect(error).toBeDefined; + expect(rental).toBeUndefined; + done(); + }) + }) +}) + + +describe('return overdue rentals', function () { + it('not be null', function (done) { + Rental.getOverdue(function(error, movie) { + expect(error).toBeNull; + expect(movie).toBeDefined; + done(); + }) + }) + + it('will not find invalid movies', function (done) { + Rental.getOverdue(function(error, rental) { + expect(error).toBeDefined; + expect(rental).toBeUndefined; + done(); + }) + }) + + it('should return an array', function(done) { + Rental.getOverdue(function(error,rentals){ + expect(rentals).toEqual(jasmine.any(Array)) + done() + }) + }) +}) + +describe('return rentals', function () { + it('not be null', function (done) { + Rental.getReturn(3, function(error, movie) { + expect(error).toBeNull; + expect(movie).toBeDefined; + done(); + }) + }) + + it('will not return invalid rentals', function (done) { + Rental.getReturn(1255, function(error, rental) { + expect(error).toBeDefined; + expect(rental).toBeUndefined; + done(); + }) + }) +}) + + +describe('checkout rentals', function () { + it('not be null', function (done) { + Rental.getCheckout("Jaws", 5, function(error, movie) { + expect(error).toBeNull; + expect(movie).toBeDefined; + done(); + }) + }) + + it('will not checkout invalid movies', function (done) { + Rental.getCheckout("a;sldfjlaskdf", 5, function(error, rental) { + expect(error).toBeDefined; + expect(rental).toBeUndefined; + done(); + }) + }) +}) From b2fc6f8eea0cbdbe232fac3470655b7d1e260c1d Mon Sep 17 00:00:00 2001 From: Alysia Brown Date: Fri, 24 Jun 2016 16:49:52 -0700 Subject: [PATCH 69/69] Finally got 90% test coverage. PR commit and byeeeeee --- models/rentals_model.js | 6 +++--- routes/index.js | 6 +++--- spec/controllers/customers.spec.js | 2 +- spec/controllers/index.spec.js | 21 ++++++++++++++++++++ spec/models/customers_model.spec.js | 7 +++++++ spec/models/movies_model.spec.js | 12 ++++++------ spec/models/rentals_model.spec.js | 30 ++++++++++++++++++++++++++--- 7 files changed, 68 insertions(+), 16 deletions(-) diff --git a/models/rentals_model.js b/models/rentals_model.js index 7e1edfa0d..99708bad0 100644 --- a/models/rentals_model.js +++ b/models/rentals_model.js @@ -11,12 +11,12 @@ var Rental = function(movie_id, customer_id, created_date, due_date, returned = }; -Rental.getCheckedOut = function(title, callback) { - db.rentals.where("title=$1 AND returned=$2", [title, false], function(error, checked_out) { +Rental.getCheckedOut = function(movie_id, callback) { + db.rentals.where("movie_id=$1 AND returned=$2", [movie_id, false], function(error, checked_out) { if(error|| !checked_out) { return callback(error || new Error("No results from database"), undefined); } else { - callback(null, checked_out); + callback(null, new Rental(checked_out)); } }) } diff --git a/routes/index.js b/routes/index.js index 312d4901f..c96859043 100644 --- a/routes/index.js +++ b/routes/index.js @@ -14,8 +14,8 @@ router.get('/', function(req, res, next) { res.status(200).json({index: 'index'}) }); -router.get('/zomg', function(req, res, next) { - res.status(200).json({whatevs: 'it works!!!!'}) -}); +// router.get('/zomg', function(req, res, next) { +// res.status(200).json({whatevs: 'it works!!!!'}) +// }); module.exports = router; diff --git a/spec/controllers/customers.spec.js b/spec/controllers/customers.spec.js index 7a206310a..5ea962701 100644 --- a/spec/controllers/customers.spec.js +++ b/spec/controllers/customers.spec.js @@ -112,4 +112,4 @@ describe("Endpoints under /customers/:id/history", function() { done() }) }); -}); +}) diff --git a/spec/controllers/index.spec.js b/spec/controllers/index.spec.js index 4c1b47e97..6c989a917 100644 --- a/spec/controllers/index.spec.js +++ b/spec/controllers/index.spec.js @@ -8,4 +8,25 @@ describe("Endpoint at /", function () { done() }) }) + + // it("should be json", function(done) { + // request.get(base_url, function(error, response, body) { + // expect(response.headers['content-type']).toBeNull + // done() + // }) + // }); + // + // it("should be an array of objects", function(done) { + // request.get(base_url, function(error, response, body) { + // var data = JSON.parse(body) + // expect(typeof data).toEqual('object') + // + // expect(Object.keys(data[0])).toBeNull + // + // done() + // }) + // }); + + + }) diff --git a/spec/models/customers_model.spec.js b/spec/models/customers_model.spec.js index bc02add34..05360c51f 100644 --- a/spec/models/customers_model.spec.js +++ b/spec/models/customers_model.spec.js @@ -22,4 +22,11 @@ describe('#sort', function () { done() }) }) + + it('should not sort by invalid column name', function (done) { + Customer.sort('nemo', 10, 2, function (error, data) { + expect(typeof data).toBeNull; + done() + }) + }) }) diff --git a/spec/models/movies_model.spec.js b/spec/models/movies_model.spec.js index 8768eb8f0..f8d0dbd48 100644 --- a/spec/models/movies_model.spec.js +++ b/spec/models/movies_model.spec.js @@ -41,23 +41,23 @@ describe('return all movies', function () { describe('return sorted movies', function () { it('not be null', function (done) { - Movie.findMovie("title", function(error, movie) { + Movie.sort("title", 2, 10, function(error, movie) { expect(error).toBeNull; expect(movie).toBeDefined; done(); }) }) - it('should contain movie objects', function (done) { - Movie.all(function (error, movies) { - expect(movies[0]).toEqual(jasmine.any(Movie)) + it('should contain sorted movie objects', function (done) { + Movie.sort("title", 2, 10, function (error, movies) { + expect(movies[0].title).toEqual("A Clockwork Orange") done() }) }) it('should contain all movies', function (done) { - Movie.all(function (error, movies) { - expect(movies.length).toEqual(100) + Movie.sort("title", 2, 100, function (error, movies) { + expect(movies.length).toEqual(98) done() }) }) diff --git a/spec/models/rentals_model.spec.js b/spec/models/rentals_model.spec.js index d7d3bf062..21e42ceac 100644 --- a/spec/models/rentals_model.spec.js +++ b/spec/models/rentals_model.spec.js @@ -5,7 +5,7 @@ var Rental = require('../../models/rentals_model') describe('Rental getCheckedOut', function () { it('not be null', function (done) { - Rental.getCheckedOut("Jaws", function(error, rental) { + Rental.getCheckedOut(5, function(error, rental) { expect(error).toBeNull; expect(rental).toBeDefined; done(); @@ -74,6 +74,14 @@ describe('return previously checked out movies', function () { done(); }) }) + + it('not be null', function (done) { + Rental.getPastRentals(5, function(error, movie) { + expect(error).toBeNull; + expect(movie).toBeDefined; + done(); + }) + }) }) describe('return previously checked out movies', function () { @@ -141,9 +149,9 @@ describe('return rentals', function () { describe('checkout rentals', function () { it('not be null', function (done) { - Rental.getCheckout("Jaws", 5, function(error, movie) { + Rental.getCheckout("Jaws", 2, function(error, rental) { expect(error).toBeNull; - expect(movie).toBeDefined; + expect(rental).toBeDefined; done(); }) }) @@ -155,4 +163,20 @@ describe('checkout rentals', function () { done(); }) }) + + it('should be a new instance of rental', function(done) { + Rental.getCheckout('Jaws', 4, function(error,rentals){ + expect(this.movie_id).toNotBe(null) + done() + }) + }) + + it('should not create an invalid instance of rental', function (done) { + Rental.getCheckout('nemo', 999, function (error, data) { + expect(typeof data).toBeNull; + done() + }) + }) + + })