Skip to content
Extraits de code Groupes Projets
Valider 60988907 rédigé par danielgrippi's avatar danielgrippi
Parcourir les fichiers

redirect to post show on create

parent 9b02633d
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -17,6 +17,7 @@ app.pages.Framer = app.views.Base.extend({
this.model.authorIsCurrentUser = function(){ return true }
this.model.bind("change", this.render, this)
this.model.bind("sync", this.navigateToShow, this)
this.templatePicker = new app.views.TemplatePicker({ model: this.model })
},
......@@ -24,6 +25,10 @@ app.pages.Framer = app.views.Base.extend({
return app.views.Post.showFactory(this.model)
},
navigateToShow : function(){
app.router.navigate(this.model.url(), {trigger: true, replace: true})
},
saveFrame : function(){
this.model.save()
}
......
......@@ -23,5 +23,14 @@ describe("app.pages.Framer", function(){
this.page.$("button.done").click();
expect(app.frame.save).toHaveBeenCalled();
});
it("navigates on save", function(){
spyOn(app.router, "navigate")
this.page.model.set({id : 22})
this.page.model.trigger("sync")
console.log(app.router.navigate)
expect(app.router.navigate).toHaveBeenCalled()
})
});
});
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter