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:
parent
dcc2bcd233
commit
20c79f1bb2
4 changed files with 17 additions and 6 deletions
|
|
@ -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 named "Alice Smith" with email "alice@alice.alice"
|
||||||
And a user with email "bob@bob.bob" is connected with "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 Alice has a post mentioning Bob
|
||||||
|
And I sign in as "bob@bob.bob"
|
||||||
|
|
||||||
|
|
||||||
Scenario: Blocking a user
|
Scenario: Blocking a user
|
||||||
When I sign in as "bob@bob.bob"
|
When I am on the home page
|
||||||
And 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 preemptively confirm the alert
|
||||||
And I wait for the ajax to finish
|
And I wait for the ajax to finish
|
||||||
When I click on the first block button
|
When I click on the first block button
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
app.models.Block = Backbone.Model.extend({
|
app.models.Block = Backbone.Model.extend({
|
||||||
urlRoot : "blocks"
|
urlRoot : "/blocks"
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
{{#if current_user}}
|
{{#if current_user}}
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
{{#if authorIsCurrentUser}}
|
{{#if authorIsNotCurrentUser}}
|
||||||
<a href="#" rel=nofollow>
|
<a href="#" rel=nofollow>
|
||||||
<img src="{{imageUrl "/images/icons/ignoreuser.png"}}"" alt="Ignoreuser" class="block_user control_icon" title="{{t "ignore"}}" />
|
<img src="{{imageUrl "/images/icons/ignoreuser.png"}}"" alt="Ignoreuser" class="block_user control_icon" title="{{t "ignore"}}" />
|
||||||
</a>
|
</a>
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ app.views.Post = app.views.StreamObject.extend({
|
||||||
|
|
||||||
presenter : function() {
|
presenter : function() {
|
||||||
return _.extend(this.defaultPresenter(), {
|
return _.extend(this.defaultPresenter(), {
|
||||||
authorIsCurrentUser : this.authorIsCurrentUser(),
|
authorIsNotCurrentUser : this.authorIsNotCurrentUser(),
|
||||||
showPost : this.showPost()
|
showPost : this.showPost()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
@ -114,7 +114,7 @@ app.views.Post = app.views.StreamObject.extend({
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
authorIsCurrentUser : function() {
|
authorIsNotCurrentUser : function() {
|
||||||
return this.model.get("author").id != (!!app.user() && app.user().id)
|
return this.model.get("author").id != (!!app.user() && app.user().id)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue