diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 068c17b71..10da73712 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -20,7 +20,7 @@ module UsersHelper commentable.title + "".html_safe else - link_to(commentable.title, commentable) + link_to(commentable.title, comment) end end diff --git a/spec/helpers/users_helper_spec.rb b/spec/helpers/users_helper_spec.rb index 2094cea04..f1a72cd36 100644 --- a/spec/helpers/users_helper_spec.rb +++ b/spec/helpers/users_helper_spec.rb @@ -31,9 +31,9 @@ describe UsersHelper do end describe '#comment_commentable_title' do - it "should return a link to the commentable" do + it "should return a link to the comment" do comment = create(:comment) - expect(comment_commentable_title(comment)).to eq link_to comment.commentable.title, comment.commentable + expect(comment_commentable_title(comment)).to eq link_to comment.commentable.title, comment end it "should return a hint if the commentable has been deleted" do