Loading Changelog.md +1 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ ## Features * Add support for mentions in comments to the backend [#6818](https://github.com/diaspora/diaspora/pull/6818) * Add support for new mention syntax [#7300](https://github.com/diaspora/diaspora/pull/7300) * Add support for new mention syntax [#7300](https://github.com/diaspora/diaspora/pull/7300) [#7394](https://github.com/diaspora/diaspora/pull/7394) * Render mentions as links in comments [#7327](https://github.com/diaspora/diaspora/pull/7327) * Add support for mentions in comments to the front-end [#7386](https://github.com/diaspora/diaspora/pull/7386) Loading lib/diaspora/mentions_container.rb +1 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ module Diaspora included do before_create do # TODO: remove when most of the posts can handle the new syntax self.text = Diaspora::Mentionable.backport_mention_syntax(text) if text self.text = Diaspora::Mentionable.backport_mention_syntax(text) if text && author.local? end after_create :create_mentions Loading spec/shared_behaviors/mentions_container.rb +7 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,13 @@ shared_examples_for "it is mentions container" do obj.save expect(obj.text).to eq(expected_text) end it "doesn't backport mention syntax if author is not local" do text = "mention @{#{people[0].diaspora_handle}} text" obj = FactoryGirl.build(described_class.to_s.underscore.to_sym, text: text, author: remote_raphael) obj.save expect(obj.text).to eq(text) end end describe ".after_create" do Loading Loading
Changelog.md +1 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ ## Features * Add support for mentions in comments to the backend [#6818](https://github.com/diaspora/diaspora/pull/6818) * Add support for new mention syntax [#7300](https://github.com/diaspora/diaspora/pull/7300) * Add support for new mention syntax [#7300](https://github.com/diaspora/diaspora/pull/7300) [#7394](https://github.com/diaspora/diaspora/pull/7394) * Render mentions as links in comments [#7327](https://github.com/diaspora/diaspora/pull/7327) * Add support for mentions in comments to the front-end [#7386](https://github.com/diaspora/diaspora/pull/7386) Loading
lib/diaspora/mentions_container.rb +1 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ module Diaspora included do before_create do # TODO: remove when most of the posts can handle the new syntax self.text = Diaspora::Mentionable.backport_mention_syntax(text) if text self.text = Diaspora::Mentionable.backport_mention_syntax(text) if text && author.local? end after_create :create_mentions Loading
spec/shared_behaviors/mentions_container.rb +7 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,13 @@ shared_examples_for "it is mentions container" do obj.save expect(obj.text).to eq(expected_text) end it "doesn't backport mention syntax if author is not local" do text = "mention @{#{people[0].diaspora_handle}} text" obj = FactoryGirl.build(described_class.to_s.underscore.to_sym, text: text, author: remote_raphael) obj.save expect(obj.text).to eq(text) end end describe ".after_create" do Loading