summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorblackst0ne <blackst0ne.ru@gmail.com>2017-03-29 08:27:05 +1100
committerblackst0ne <blackst0ne.ru@gmail.com>2017-03-29 08:27:05 +1100
commite06015379739ce6ee57318d35d18e274f4e930a6 (patch)
treee08034039b11984d692e2efbdf4675d4379c806d /spec
parentad831ace7ed8d2ed999b15f8350aaa51f0490124 (diff)
downloadgitlab-ce-e06015379739ce6ee57318d35d18e274f4e930a6.tar.gz
Make user mentions case-insensitive
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/banzai/filter/user_reference_filter_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/lib/banzai/filter/user_reference_filter_spec.rb b/spec/lib/banzai/filter/user_reference_filter_spec.rb
index 9873774909e..63b23dac7ed 100644
--- a/spec/lib/banzai/filter/user_reference_filter_spec.rb
+++ b/spec/lib/banzai/filter/user_reference_filter_spec.rb
@@ -83,6 +83,14 @@ describe Banzai::Filter::UserReferenceFilter, lib: true do
expect(doc.css('a').length).to eq 1
end
+ it 'links to a User with different case-sensitivity' do
+ user = create(:user, username: 'RescueRanger')
+
+ doc = reference_filter("Hey #{user.to_reference.upcase}")
+ expect(doc.css('a').length).to eq 1
+ expect(doc.css('a').text).to eq(user.to_reference)
+ end
+
it 'includes a data-user attribute' do
doc = reference_filter("Hey #{reference}")
link = doc.css('a').first