remove PostViewerFeedback

This commit is contained in:
Fabian Rodriguez 2013-12-01 17:55:56 -02:00
parent 9be780468d
commit cfc247db75
3 changed files with 0 additions and 107 deletions

View file

@ -1,34 +0,0 @@
//= require ../feedback_view
app.views.PostViewerFeedback = app.views.Feedback.extend({
id : "user-controls",
className : "",
templateName: "post-viewer/feedback",
subviews : {
".feedback-actions" : "feedbackActions"
},
events :_.extend({}, app.views.Feedback.prototype.events, {
"click *[rel='invoke-interaction-pane']" : "invokePane",
"click *[rel='hide-interaction-pane']" : "hidePane"
}),
initViews : function(){
this.feedbackActions = new app.views.FeedbackActions({model : this.model})
},
postRenderTemplate : function() {
this.sneakyVisiblity()
},
sneakyVisiblity : function() {
if(!$("#post-info").is(":visible")) {
this.$("#post-info-sneaky").removeClass('passive')
}
},
invokePane : function(evt){ this.trigger("invokePane") },
hidePane : function(evt){ this.trigger("hidePane") },
});

View file

@ -1,18 +0,0 @@
<div class="feedback-actions"/>
<!-- this acts as a dock underlay -->
<div id="post-info-sneaky" class="passive">
<div id="post-info-container-sneaky">
<a href="#" rel="invoke-interaction-pane" class="invoker">
<img src="{{imageUrl "up-tick-inset.png"}}" class="info-tick"/>
</a>
</div>
</div>
<!-- this closes an open interaction pane -->
<div id="close-reactions-pane">
<div id="close-reactions-pane-container">
<a href="#" rel="hide-interaction-pane" class="invoker"></a>
</div>
</div>

View file

@ -1,55 +0,0 @@
describe("app.views.FeedbackActions", function(){
beforeEach(function(){
loginAs({id : -1, name: "alice", avatar : {small : "http://avatar.com/photo.jpg"}});
this.post = new app.models.Post({
"author": {
"diaspora_id": "alice@localhost:3000"
},
"post_type": "Reshare",
"public": true,
"root": {
"author":{"diaspora_id": null}
}
})
this.view = new app.views.PostViewerFeedback({model: this.post})
});
describe("FeedbackActions", function(){
it("reshares a post", function(){
spyOn(window, "confirm").andReturn(true)
spyOn(this.view.model.interactions, "reshare")
this.view.render()
this.view.$('.reshare').click()
expect(this.view.model.interactions.reshare.callCount).toBe(1)
expect(window.confirm.callCount).toBe(1)
});
it('cancels a reshare confirmation ', function(){
spyOn(window, "confirm").andReturn(false)
spyOn(this.view.model.interactions, "reshare")
this.view.render()
this.view.$('.reshare').click()
expect(this.view.model.interactions.reshare).not.toHaveBeenCalled();
});
it("likes a post", function(){
spyOn(this.view.model.interactions, "toggleLike")
this.view.render()
this.view.$('.like').click()
expect(this.view.model.interactions.toggleLike.callCount).toBe(1)
})
})
})