Use name of mentioned person in plain text
This commit is contained in:
parent
322f92110a
commit
0e89d60117
2 changed files with 13 additions and 1 deletions
|
|
@ -79,7 +79,7 @@ module Diaspora
|
||||||
end
|
end
|
||||||
|
|
||||||
def make_mentions_plain_text
|
def make_mentions_plain_text
|
||||||
@message = Diaspora::Mentionable.format message, [], plain_text: true
|
@message = Diaspora::Mentionable.format message, options[:mentioned_people], plain_text: true
|
||||||
end
|
end
|
||||||
|
|
||||||
def render_tags
|
def render_tags
|
||||||
|
|
|
||||||
|
|
@ -191,6 +191,18 @@ describe Diaspora::MessageRenderer do
|
||||||
text = "#hashtag message"
|
text = "#hashtag message"
|
||||||
expect(message(text).plain_text_without_markdown).to eq text
|
expect(message(text).plain_text_without_markdown).to eq text
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context "with mention" do
|
||||||
|
it "contains the name of the mentioned person" do
|
||||||
|
msg = message("@{#{alice.diaspora_handle}} is cool", mentioned_people: alice.person)
|
||||||
|
expect(msg.plain_text_without_markdown).to eq "#{alice.name} is cool"
|
||||||
|
end
|
||||||
|
|
||||||
|
it "uses the name from mention when the mention contains a name" do
|
||||||
|
msg = message("@{Alice; #{alice.diaspora_handle}} is cool", mentioned_people: alice.person)
|
||||||
|
expect(msg.plain_text_without_markdown).to eq "Alice is cool"
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "#urls" do
|
describe "#urls" do
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue