Render mentions as links in comments

parent 99351bd1
......@@ -20,7 +20,7 @@ app.views.Comment = app.views.Content.extend({
presenter : function() {
return _.extend(this.defaultPresenter(), {
canRemove: this.canRemove(),
text : app.helpers.textFormatter(this.model.get("text"))
text: app.helpers.textFormatter(this.model.get("text"), this.model.get("mentioned_people"))
......@@ -5,11 +5,12 @@ class CommentPresenter < BasePresenter
def as_json(opts={})
:id =>,
:guid => @comment.guid,
:text => @comment.message.plain_text_for_json,
:author =>,
:created_at => @comment.created_at
guid: @comment.guid,
text: @comment.message.plain_text_for_json,
created_at: @comment.created_at,
mentioned_people: @comment.mentioned_people.as_api_response(:backbone)
......@@ -54,3 +54,15 @@ Feature: Mentions
Then I should see "Bob Jones" within ".stream-element"
When I follow "Bob Jones"
Then I should see "Bob Jones"
Scenario: A user mentions another user in a comment and it displays correctly
Given following users exist:
| username | email |
| Bob Jones | bob@bob.bob |
| Alice Smith | alice@alice.alice |
And a user with email "bob@bob.bob" is connected with "alice@alice.alice"
And "alice@alice.alice" has a public post with text "check this out!"
And "alice@alice.alice" has commented mentioning "bob@bob.bob" on "check this out!"
When I sign in as "alice@alice.alice"
And I follow "Bob Jones"
Then I should see "Bob Jones"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment