add a missing test for block user, and fix ignoring a user from a non stream page; rename a javascript method as it was actually the oppisite of what it said it was doing

This commit is contained in:
Maxwell Salzberg 2012-02-16 17:15:03 -08:00
parent dcc2bcd233
commit 20c79f1bb2
4 changed files with 17 additions and 6 deletions

View file

@ -5,11 +5,22 @@ Feature: Blocking a user from the stream
And a user named "Alice Smith" with email "alice@alice.alice"
And a user with email "bob@bob.bob" is connected with "alice@alice.alice"
And Alice has a post mentioning Bob
And I sign in as "bob@bob.bob"
Scenario: Blocking a user
When I sign in as "bob@bob.bob"
And I am on the home page
When I am on the home page
And I preemptively confirm the alert
And I wait for the ajax to finish
When I click on the first block button
And I am on the home page
And I wait for the ajax to finish
Then I should not see any posts in my stream
Scenario: Blocking a user from the profile page
When I am on the home page
And I follow "Alice Smith"
And I wait for the ajax to finish
And I preemptively confirm the alert
And I wait for the ajax to finish
When I click on the first block button

View file

@ -1,3 +1,3 @@
app.models.Block = Backbone.Model.extend({
urlRoot : "blocks"
urlRoot : "/blocks"
});

View file

@ -2,7 +2,7 @@
{{#if current_user}}
<div class="controls">
{{#if authorIsCurrentUser}}
{{#if authorIsNotCurrentUser}}
<a href="#" rel=nofollow>
<img src="{{imageUrl "/images/icons/ignoreuser.png"}}"" alt="Ignoreuser" class="block_user control_icon" title="{{t "ignore"}}" />
</a>

View file

@ -51,7 +51,7 @@ app.views.Post = app.views.StreamObject.extend({
presenter : function() {
return _.extend(this.defaultPresenter(), {
authorIsCurrentUser : this.authorIsCurrentUser(),
authorIsNotCurrentUser : this.authorIsNotCurrentUser(),
showPost : this.showPost()
})
},
@ -114,7 +114,7 @@ app.views.Post = app.views.StreamObject.extend({
return this;
},
authorIsCurrentUser : function() {
authorIsNotCurrentUser : function() {
return this.model.get("author").id != (!!app.user() && app.user().id)
}
});