This repository has been archived by the owner on Mar 8, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Edmund von der Burg
committed
Apr 24, 2012
1 parent
0a19f48
commit aa3d9b8
Showing
6 changed files
with
81 additions
and
1 deletion.
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
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,20 @@ | ||
var path = require('path'), | ||
Error404 = require('../../lib/errors').Error404; | ||
|
||
exports.route = function (app) { | ||
app.get('/info/:page', function(req, res, next){ | ||
|
||
var template_file = req.app.set('views') + '/info/' + req.param('page') + '.jade'; | ||
|
||
path.exists(template_file, function (exists) { | ||
if (exists) { | ||
res.render( 'info/' + req.param('page') ); | ||
} else { | ||
next(new Error404()); | ||
} | ||
}); | ||
|
||
}); | ||
}; | ||
|
||
|
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,3 @@ | ||
extends ../layout | ||
|
||
// info page specific layout changes can go here |
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,8 @@ | ||
extend layout | ||
|
||
block title | ||
| Privacy | ||
|
||
block content | ||
h1 Privacy | ||
p FIXME: privacy text goes here |
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,46 @@ | ||
// switch to testing mode | ||
process.env.NODE_ENV = 'testing'; | ||
|
||
var utils = require('../lib/utils'), | ||
selenium_helpers = require('../lib/testing/selenium'), | ||
config = require('config'), | ||
async = require('async'); | ||
|
||
|
||
|
||
module.exports = { | ||
|
||
setUp: function (setUp_done) { | ||
|
||
utils.delete_all_testing_databases( function () { | ||
selenium_helpers.start_servers( function () { | ||
setUp_done(); | ||
}); | ||
}); | ||
}, | ||
|
||
tearDown: function (tearDown_done) { | ||
selenium_helpers.stop_servers(tearDown_done); | ||
}, | ||
|
||
"Check info pages": function (test) { | ||
|
||
var browser = selenium_helpers.new_hosting_browser(); | ||
|
||
test.expect(2); | ||
|
||
browser | ||
.open('/info/does_not_exist') | ||
.assertTextPresent('Page not found') | ||
.open('/info/privacy') | ||
.assertTextPresent('privacy text goes here') | ||
.testComplete() | ||
.end(function (err) { | ||
test.ifError(err); | ||
test.ok(true, "end of tests"); | ||
test.done(); | ||
}); | ||
}, | ||
|
||
}; | ||
|