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
var view = new Controller.View(Template['account.layout'], Template['account.index']); | |
var routeList = new Router.SimpleRouteList([ | |
new Router.Routes.Segment('/:module[/[:action]]', {module: 'index', action: 'index'}) | |
]); | |
var reactiveRouter = new Router.Reactive(routeList, Meteor.Location.getPath); | |
var dispatcher = new Controller.Dispatcher(reactiveRouter.match, [ | |
new InnoAccel.Account.Controller.Index(view), | |
new InnoAccel.Account.Controller.Project(view) | |
]); |
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
(function (Controller, Template, parent) { | |
"use strict"; | |
Controller.Project = function (view) { | |
parent.call(this, {module: 'account', 'action': 'projects'}); | |
this.canDispatch = function (match) { | |
if (null === Meteor.user()) { | |
Meteor.Location.setPath('/authorization/login'); | |
} |
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
(function (Controller, _) { | |
"use strict"; | |
Controller.BasicController = function (parameters) { | |
var paramKeys = _.keys(parameters); | |
this.canDispatch = function (match) { | |
return _.every(paramKeys, function (c) { | |
return parameters[c] === match.getParam(c); | |
}); |
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
(function (Controller, Deps, _) { | |
"use strict"; | |
Controller.Dispatcher = function (matchingSource, controllers) { | |
var self = this; | |
var availableControllers = controllers || [], | |
controllerDependants = new Deps.Dependency(), | |
currentController; |
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
Meteor.startup(function () { | |
"use strict"; | |
// GLOBAL | |
var routes = {}; | |
var router = new Meteor.PageRouter(); | |
var navKeyFunc = function () { | |
return router.nav(); | |
}; |
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
it('Can be viewed when logged in', function (done) { | |
driver.loginWithPassword('[email protected]', 'test12'); | |
driver.goToPage('account'); | |
driver.getCurrentUrl().then(function (realURL) { | |
realURL.should.equal(driver.getUrlOfPage('account')); | |
}).then(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
function start_app { | |
NODE_ENV=production nohup "node" "main.js" 1>>"main.log" 2>&1 &' | |
echo $! > "app.pid" | |
} | |
function stop_app { | |
kill `cat app.pid` | |
} |
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
Login | |
- Information to recover password | |
- Information to register | |
Requires valid credentials | |
- Accepts valid credentials | |
- Rejects invalid user | |
Account page | |
â Can't access when not logged in | |
â Can be viewed when logged in |
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
describe('Login', function () { | |
"use strict"; | |
var driver, | |
createDriver = require('../lib/client').driver; | |
beforeEach(function (done) { | |
driver = createDriver(); | |
driver.goToPage('login') | |
.then(function () {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
describe('Account page', function () { | |
"use strict"; | |
var driver, | |
createDriver = require('../lib/client').driver; | |
beforeEach(function (done) { | |
driver = createDriver(); | |
driver.goToPage('index') | |
.then(function () {done(); }); |