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
# activity.rb | |
def full_duration | |
return (duration_in_minutes.to_f / 60).round(1) | |
end | |
# activity_spec.rb | |
describe "full_duration()" do | |
context "when duration_in_minutes is saved in the database" do |
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 doTest (callback) { | |
var isCallbackCalled = false; | |
var successCallback = function () { | |
isCallbackCalled = true; | |
}; | |
callback.apply(null, [ successCallback ]); | |
if (isCallbackCalled) { |
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
TypeError: Object #<World> has no method 'visit' | |
at World.<anonymous> (/Users/jnh/Dev/ember-newsflash/features/step_definitions/inMemoryAdapter.coffee:8:19) | |
at Object.invoke (/Users/jnh/Dev/ember-newsflash/node_modules/cucumber/lib/cucumber/support_code/step_definition.js:29:14) | |
at Object.execute (/Users/jnh/Dev/ember-newsflash/node_modules/cucumber/lib/cucumber/ast/step.js:142:22) | |
at Object.acceptVisitor (/Users/jnh/Dev/ember-newsflash/node_modules/cucumber/lib/cucumber/ast/step.js:133:12) | |
at Object.executeStep (/Users/jnh/Dev/ember-newsflash/node_modules/cucumber/lib/cucumber/runtime/ast_tree_walker.js:170:12) | |
at Object.processStep (/Users/jnh/Dev/ember-newsflash/node_modules/cucumber/lib/cucumber/runtime/ast_tree_walker.js:165:14) | |
at /Users/jnh/Dev/ember-newsflash/node_modules/cucumber/lib/cucumber/runtime/ast_tree_walker.js:67:16 | |
at callUserFunctionAndBroadcastAfterEvent (/Users/jnh/Dev/ember-newsflash/node_modules/cucumber/lib/cucumber/runtime/ast_tree_walker.js:91:9) | |
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
server.get('/parseXML2', function (req, res) { | |
fs.readFile('./export/2012_09_13_22_14_10-63Q1.xml', function (err, file) { | |
var xml = libxmljs.parseXml(file); | |
var date = xml.get("/rFactorXML/RaceResults/TimeString").text(); | |
var track = xml.get("/rFactorXML/RaceResults/TrackEvent").text(); | |
var trackLength = xml.get("/rFactorXML/RaceResults/TrackLength").text(); | |
var mod = xml.get("/rFactorXML/RaceResults/Mod").text(); | |
var drivers = xml.find("//Driver"); | |
Track.findOne({name: track}).exec(function (err, existingTrack) { |
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 mongoose = require('mongoose'); | |
var Schema = mongoose.Schema; | |
var qualificationSchema = new mongoose.Schema ({ | |
date : Date, | |
track : {type: Schema.ObjectId, ref : 'Track'}, | |
mod : {type: Schema.ObjectId, ref : 'Mod'}, | |
entrys : [entrySchema] | |
}); | |
var Qualification = mongoose.model('Qualification', qualificationSchema); |
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
DEBUG: TypeError: Cannot read property 'value' of undefined | |
at _asyncMap (/home/pitbi/Projects/RaceLive/node_modules/async/lib/async.js:185:23) | |
at async.forEachSeries.iterate (/home/pitbi/Projects/RaceLive/node_modules/async/lib/async.js:108:13) | |
at async.forEachSeries.iterate (/home/pitbi/Projects/RaceLive/node_modules/async/lib/async.js:119:25) | |
at _asyncMap (/home/pitbi/Projects/RaceLive/node_modules/async/lib/async.js:187:17) | |
at async.series.results (/home/pitbi/Projects/RaceLive/node_modules/async/lib/async.js:491:34) | |
at async.forEach (/home/pitbi/Projects/RaceLive/node_modules/async/lib/async.js:94:25) | |
at bestLapSearch (/home/pitbi/Projects/RaceLive/lib/rfactor_xml_parser.js:188:19) | |
at async.forEach (/home/pitbi/Projects/RaceLive/node_modules/async/lib/async.js:86:13) | |
at Array.forEach (native) |
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
Feature: Mailing Wizard | |
In order to send a Mailing | |
As an Administrator | |
I need to be able to create a Mailing | |
Scenario: Check the first tab has fields | |
Given I am on the Mailing Wizard | |
When I am on the first tab | |
Then I should see a "Mailing Name" input | |
And I should see a "Description" input |
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
Scenario: Create an invoice | |
Given I am an authenticated user with an admin role | |
And there is a work unit ready to be invoiced on a client's project | |
When I associate an invoice number to the work unit | |
Then The concerned client is not in the admin invoices page |
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
app.post(/^\/mobiles\/.*/, function (req, res) { | |
var postUrl = "https://d3v0fbs.net" + req.url; | |
req.pipe(request.post(postUrl)).pipe(res); | |
}); |