-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added bid create method, played around with css and added an image to…
… img folder
- Loading branch information
Showing
11 changed files
with
196 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
'use strict'; | ||
|
||
var Bid = require('../models/bid'); | ||
|
||
exports.create = function(req, res){ | ||
req.body.upForBidOwnerId = res.locals.user._id; | ||
Bid.create(req.body, req.params.itemOfferedId, function(){ | ||
res.redirect('/marketplace'); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
extends ../shared/template | ||
block content | ||
h2 Home | ||
.panel.panel-default | ||
.panel-body | ||
|
||
.homePage(style='background-image: url("/img/wine_seller.png");') | ||
block scripts | ||
script(src='/js/user/home.js') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* global describe, before, beforeEach, it */ | ||
|
||
'use strict'; | ||
|
||
process.env.DB = 'wine-seller-test'; | ||
|
||
var expect = require('chai').expect, | ||
cp = require('child_process'), | ||
app = require('../../app/index'), | ||
cookie = null, | ||
request = require('supertest'); | ||
|
||
describe('users', function(){ | ||
before(function(done){ | ||
request(app).get('/').end(done); | ||
}); | ||
|
||
beforeEach(function(done){ | ||
cp.execFile(__dirname + '/../scripts/clean-db.sh', [process.env.DB], {cwd:__dirname + '/../scripts'}, function(err, stdout, stderr){ | ||
request(app) | ||
.post('/login') | ||
.send('email=nodeapptest%2Bbob%40gmail.com&password=1234') | ||
.end(function(err, res){ | ||
cookie = res.headers['set-cookie'][0]; | ||
done(); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('post /bid', function(){ | ||
it('should redirect to marketplace page', function(done){ | ||
request(app) | ||
.post('/bidding/a00000000000000000000001') | ||
.set('cookie', cookie) | ||
.send('itemUpForBidId=a00000000000000000000006&itemOfferedId=a00000000000000000000001&offerOwnerId=000000000000000000000001&upForBidOwnerId=000000000000000000000002') | ||
.end(function(err, res){ | ||
expect(res.status).to.equal(302); | ||
expect(res.headers.location).to.equal('/marketplace'); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
|
||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
0 info it worked if it ends with ok | ||
1 verbose cli [ '/usr/local/node/bin/node', '/usr/local/node/bin/npm', 'test' ] | ||
2 info using npm@1.4.14 | ||
3 info using node@v0.10.29 | ||
4 error Error: ENOENT, open '/home/nss/apps/code/wine-seller/test/acceptance/package.json' | ||
5 error If you need help, you may report this *entire* log, | ||
5 error including the npm and node versions, at: | ||
5 error <http://github.com/npm/npm/issues> | ||
6 error System Linux 3.13.0-24-generic | ||
7 error command "/usr/local/node/bin/node" "/usr/local/node/bin/npm" "test" | ||
8 error cwd /home/nss/apps/code/wine-seller/test/acceptance | ||
9 error node -v v0.10.29 | ||
10 error npm -v 1.4.14 | ||
11 error path /home/nss/apps/code/wine-seller/test/acceptance/package.json | ||
12 error code ENOENT | ||
13 error errno 34 | ||
14 verbose exit [ 34, true ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters