Closed caio-ribeiro-pereira closed 10 years ago
I am currently working around this by simply testing in with a "real" and logged in user. This can be done by calling Accounts.createUser({email: 'a@a.com', password: '123456'});
on the server and something like
Meteor.loginWithPassword('a@a.com', '123456', function() {
Post = new Meteor.Collection('posts');
Post.publish = function(message) {
var currentUser = Meteor.user();
this.insert({
message: message
, time: new Date()
, userId: currentUser._id
, name: currentUser.profile.name
});
};
});
on the client.
Thanks!
Hi, I'm new using Laika, and I'd like to know how can I mock Meteor.user() object, testing this function:
I just would like to test if the post was added using a fake Meteor.user() to test it.
This is a simple test which is not working, because of Meteor.user() object:
Does anybody can help me solving this?
Thanks!