FIX: don't extract link with 'mailto' scheme

This commit is contained in:
Régis Hanol
2016-04-05 00:43:11 +02:00
parent b00ea5dc92
commit f382897952
2 changed files with 16 additions and 7 deletions

View File

@@ -164,6 +164,15 @@ http://b.com/#{'a'*500}
end
end
context "mail link" do
let(:post) { topic.posts.create(user: user, raw: "[email]bar@example.com[/email]") }
it 'does not extract a link' do
TopicLink.extract_from(post)
expect(topic.topic_links).to be_blank
end
end
context "quote links" do
it "sets quote correctly" do
linked_post = topic.posts.create(user: user, raw: "my test post")