This file contains hidden or 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
| /** | |
| * Safely access to a variable value using dot notation 'loan.city.name' | |
| * | |
| * @param {Object} locals Temlate variables | |
| * @param {String} dotPath Path to a variable, for ex. 'loan.city.name' | |
| * @param {String} defValue Fallback value | |
| * @return {Mixed} | |
| */ | |
| safeVar: function(locals, dotPath, defValue) { | |
| var value = _.reduce(dotPath.split('.'), function(res, token) { |
This file contains hidden or 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
| #!/usr/bin/env node | |
| 'use strict' | |
| var common = require('../.') | |
| common.derp.db.init({models: common.models}).connect(common.settings.db.uri, function(err) { | |
| console.log("done"); | |
| }) |
This file contains hidden or 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
| Noti.sendSuccessOrderLoan = function(loanOrder, cb) { | |
| email.send('success-order-loan', loanOrder, {}, cb) | |
| } |
This file contains hidden or 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 page = require('webpage').create(); | |
| page.onResourceRequested = function(request) { | |
| console.log('Request ' + JSON.stringify(request.url, undefined, 4)); | |
| }; | |
| page.onResourceReceived = function(response) { | |
| //console.log('Receive ' + JSON.stringify(response.url, undefined, 4)); | |
| }; | |
| page.open('http://local.ros-dengi.ru', function(status) { |
This file contains hidden or 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
| "use strict" | |
| var chai = require('chai'), | |
| assert = chai.assert, | |
| expect = chai.expect, | |
| webdriverio = require('webdriverio'); | |
| describe('Loan order process', function(){ | |
| this.timeout(99999999); | |
| var client = {}; | |
| before(function(done){ | |
| client = webdriverio.remote({ desiredCapabilities: {browserName: 'firefox'} }); |
This file contains hidden or 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
| div | |
| strong Контактные лица: | |
| {{#each contacts}} | |
| div {{this.firstname}} {{this.middlename}} {{this.lastname}} | |
| div Кем приходится: {{this.relationship}} | |
| div Телефон: {{this.phone}} | |
| br | |
| {{/each}} |
This file contains hidden or 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
| "use strict" | |
| process.env.NODE_ENV = 'testing' | |
| process.env.PORT = '8001' | |
| process.env.DIR_PUBLIC = __dirname + '/../public' | |
| var chai = require('chai'), | |
| assert = chai.assert, | |
| expect = chai.expect, | |
| webdriverio = require('webdriverio'), |
This file contains hidden or 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
| client.addCommand("waitForFunc", function(checker, timeout) { | |
| if (typeof timeout === 'function') { | |
| cb = timeout | |
| timeout = this.options.waitforTimeout | |
| } | |
| return new Promise(function(fulfill, reject) { | |
| var start = new Date().getMilliseconds() | |
| var timer = setTimeout(function run() { | |
| if (!checker()) { | |
| if (new Date().getMilliseconds() > start + timeout) { |
This file contains hidden or 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
| "use strict"; | |
| var service = module.exports = {}, | |
| derp = require('derp'), | |
| async = require('async'), | |
| randomstring = require('../util/randomstring'), | |
| _ = require('lodash') | |
| ; | |
| // services |
This file contains hidden or 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
| _addViewListeners: function () { | |
| var loanCalc = this; | |
| this.listenTo(this.view, 'create:order:loan', function () { | |
| loanCalc.trigger('create:order:loan', { | |
| amount: this.model.get('amount'), | |
| term: this.model.get('term'), | |
| totalSum: this.model.get('totalSum'), | |
| repayDate: this.model.get('repayDate'), | |
| }) | |
| }) |