Skip to content
Extraits de code Groupes Projets
Valider 20c79f1b rédigé par Maxwell Salzberg's avatar Maxwell Salzberg
Parcourir les fichiers

add a missing test for block user, and fix ignoring a user from a non stream...

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
parent dcc2bcd2
Branches
Étiquettes
Aucune requête de fusion associée trouvée
......@@ -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"
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
......
app.models.Block = Backbone.Model.extend({
urlRoot : "blocks"
urlRoot : "/blocks"
});
......@@ -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>
......
......@@ -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)
}
});
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter