added spec for .like_action link being rendered; added comments div back to stream_element for now
This commit is contained in:
parent
7f51bc02ef
commit
31d24c60c7
4 changed files with 27 additions and 10 deletions
|
|
@ -1,13 +1,11 @@
|
|||
<div class="info">
|
||||
<% if(like) { %>
|
||||
<a href="#" class="like_action unlike" rel='nofollow'>
|
||||
Unlike
|
||||
</a>
|
||||
<% } else { %>
|
||||
<a href="#" class="like_action like" rel='nofollow'>
|
||||
Like
|
||||
</a>
|
||||
<% } %>
|
||||
<a href="#" class="like_action" rel='nofollow'>
|
||||
<%= like ? "Unlike" : "Like" %>
|
||||
</a>
|
||||
·
|
||||
|
||||
<a href="#" class="focus_comment_textarea" rel="nofollow">
|
||||
Comment
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@
|
|||
<% } %>
|
||||
|
||||
<div class="feedback"> </div>
|
||||
<div class="comments"> </div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -11,11 +11,14 @@ App.Views.Post = App.Views.StreamObject.extend({
|
|||
},
|
||||
|
||||
render: function() {
|
||||
// subview rendering
|
||||
this.renderTemplate()
|
||||
.initializeTooltips()
|
||||
.renderPostContent()
|
||||
.renderFeedback()
|
||||
.renderComments();
|
||||
//
|
||||
|
||||
this.initializeTooltips();
|
||||
this.$(".details time").timeago();
|
||||
|
||||
return this;
|
||||
|
|
@ -39,6 +42,14 @@ App.Views.Post = App.Views.StreamObject.extend({
|
|||
return this;
|
||||
},
|
||||
|
||||
renderFeedback: function(){
|
||||
this.$(".feedback").html(new App.Views.Feedback({
|
||||
model: this.model
|
||||
}).render().el);
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
removeNsfwShield: function(evt){
|
||||
if(evt){ evt.preventDefault(); }
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,13 @@ describe("App.views.Post", function(){
|
|||
this.statusMessage = this.collection.models[0];
|
||||
})
|
||||
|
||||
it("contains a '.like_action' link", function(){
|
||||
var view = new App.Views.Post({model : this.statusMessage}).render();
|
||||
var statusElement = $(view.el);
|
||||
|
||||
expect(statusElement.find(".like_action").html()).not.toBeNull();
|
||||
})
|
||||
|
||||
context("NSFW", function(){
|
||||
it("contains a shield element", function(){
|
||||
this.statusMessage.set({text : "this is safe for work. #sfw"});
|
||||
|
|
|
|||
Loading…
Reference in a new issue