Skip to content

Instantly share code, notes, and snippets.

this.route('home',{
path: '/:_domain',
data: function(){
if(domains.find().count() <= 0)
{
Router.go('register');
}
return {'name':this.params._domain};
},
waitOn: function(){
@bitomule
bitomule / gist:2fe7a1abfeb164e40ccc
Created July 18, 2014 09:09
Log from meteor app with jasmine and velocity
Ok, everything's ready. Here comes Meteor!
[[[[[ ~/Desktop/mymeteorapp ]]]]]
=> Started proxy.
=> Started MongoDB.
I20140718-11:07:16.323(2)? Jasmine-Unit is loaded
I20140718-11:07:16.398(2)? [velocity] PWD /Users/mango/Desktop/mymeteorapp
I20140718-11:07:16.460(2)? Check for test package configs... [ 'packages/blaze-layout/examples/simple/smart.json',
=> Started proxy.
=> Started MongoDB.
I20140718-11:38:32.833(2)? Jasmine-Unit is loaded
I20140718-11:38:32.930(2)? [velocity] PWD /Users/mango/Desktop/mymeteorapp
I20140718-11:38:33.041(2)? Check for test package configs... [ 'packages/blaze-layout/examples/simple/smart.json',
I20140718-11:38:33.041(2)? 'packages/blaze-layout/smart.json',
I20140718-11:38:33.041(2)? 'packages/chosen-package/smart.json',
I20140718-11:38:33.041(2)? 'packages/collection-hooks/smart.json',
I20140718-11:38:33.041(2)? 'packages/collection2/smart.json',
I20140718-11:38:33.042(2)? 'packages/handlebar-helpers/smart.json',
Template.sidebarProject.projectPath = function(){
return Router.path('project',{_project:'blabla',_domain:'cyan'});
};
Template.sidebarProject.events({
'click #projectLink' : function(e,t)
{
e.preventDefault();
}
});
this.route('project',{
path: '/:_domain/projects/:_project',
onBeforeAction : 'loading',
data: function(){
return {'name':this.params._domain};
},
waitOn: function(){
var subscription = subs.subscribe('userDomain',this.params._domain,function(){
if(Domains.find().count() <= 0)
{
var subs = new SubsManager({
// will be cached only 20 recently used subscriptions
cacheLimit: 20,
// any subscription will be expired after 5 minutes of inactivity
expireIn: 20
});
Router.configure({
layoutTemplate: 'layout',
loadingTemplate: 'loading'
Meteor.publish('userDomain', function(domainName) {
var domain,users;
domain = Domains.find({name:domainName});
if(domain.count() <= 0)
{
this.ready();
return null;
}
var domainId = domain.fetch()[0]._id;
if(!domainId)
this.route('project',{
path: '/:_domain/projects/:_project',
layoutTemplate: 'privateLayout',
loadingTemplate: 'loading',
data: function(){
return {'domainname':this.params._domain};
},
waitOn: function(){
return [subs.subscribe('userDomain',this.params._domain),subs.subscribe('projects'),subs.subscribe('tasks'),subs.subscribe('images')];
},
Meteor.publish('userData', function() {
if(!this.userId)
{
this.ready();
return null;
}
return Meteor.users.find(this.userId, {fields: {username:1,roles:1}});
});
subs = new SubsManager({
// will be cached only 20 recently used subscriptions
cacheLimit: 20,
// any subscription will be expired after 5 minutes of inactivity
expireIn: 20
});
Router.configure({
layoutTemplate: 'layout',
loadingTemplate: 'loading'