Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/slack_markdown_sanitizer_spec.rb')
-rw-r--r--spec/lib/slack_markdown_sanitizer_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/lib/slack_markdown_sanitizer_spec.rb b/spec/lib/slack_markdown_sanitizer_spec.rb
index f4042439213..d9552542465 100644
--- a/spec/lib/slack_markdown_sanitizer_spec.rb
+++ b/spec/lib/slack_markdown_sanitizer_spec.rb
@@ -20,4 +20,21 @@ RSpec.describe SlackMarkdownSanitizer, feature_category: :integrations do
end
end
end
+
+ describe '.sanitize_slack_link' do
+ using RSpec::Parameterized::TableSyntax
+
+ where(:input, :output) do
+ '' | ''
+ '[label](url)' | '[label](url)'
+ '<url|label>' | '&lt;url|label&gt;'
+ '<a href="url">label</a>' | '<a href="url">label</a>'
+ end
+
+ with_them do
+ it 'returns the expected output' do
+ expect(described_class.sanitize_slack_link(input)).to eq(output)
+ end
+ end
+ end
end