Skip to content

Instantly share code, notes, and snippets.

@adamrneary
Last active August 29, 2015 14:13
Show Gist options
  • Select an option

  • Save adamrneary/4c2eff5e3c893e36ed8e to your computer and use it in GitHub Desktop.

Select an option

Save adamrneary/4c2eff5e3c893e36ed8e to your computer and use it in GitHub Desktop.
describe('VideoEvents', function(){
var projectRef = getFirebaseRef();
var testId = getUniqueId();
describe('Video View', function(){
var eventName = 'Video View';
before(function(done) {
projectRef
.child(testId)
.child('events/' + eventName)
.set(100, done);
})
after(function(done) {
projectRef
.child(testId)
.remove(done);
})
it('should increment the video view event value', function(done){
var testObject = packageEvent(generateEvent(testId, eventName));
var testContext = {
done: function(error, message) {
projectRef
.child(testId)
.child('events/' + eventName)
.once("value", function(snapshot) {
assert.equal(101, snapshot.val());
done();
});
}
};
VideoEvents.handler(testObject, testContext);
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment