Created
April 19, 2014 19:41
-
-
Save hammett/11095200 to your computer and use it in GitHub Desktop.
mocha + firebase + event emitter
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("responds to 'new_user' event", function(done) { | |
var user = new Model.User({ | |
'email': '[email protected]', | |
'name': 'testing' | |
}); | |
_root.child('/users/').once('child_added', function(data) { | |
expect(data.name()).to.be(user._id.toString()); | |
var userData = data.val(); | |
expect(userData.name).to.be(user.name); | |
done(); | |
}); | |
emitter.emit('new_user', user); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment