diff options
author | Micael Bergeron <mbergeron@gitlab.com> | 2017-09-12 17:07:31 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-09-12 17:07:31 +0300 |
commit | a31e0aff224d4047e10fae98b6f9dc9f84b7457a (patch) | |
tree | 6e2367f91fd008227a44eab0408c872336249b80 /spec/lib/gitlab/git_spec.rb | |
parent | 30db01b2edd2a5ea12aff6b60bbc4bb60ed6d2d2 (diff) |
Resolve "Error 500 in non-UTF8 branch names"
Diffstat (limited to 'spec/lib/gitlab/git_spec.rb')
-rw-r--r-- | spec/lib/gitlab/git_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/lib/gitlab/git_spec.rb b/spec/lib/gitlab/git_spec.rb index 4702a978f19..494dfe0e595 100644 --- a/spec/lib/gitlab/git_spec.rb +++ b/spec/lib/gitlab/git_spec.rb @@ -1,3 +1,4 @@ +# coding: utf-8 require 'spec_helper' describe Gitlab::Git do @@ -29,4 +30,12 @@ describe Gitlab::Git do end end end + + describe '.ref_name' do + it 'ensure ref is a valid UTF-8 string' do + utf8_invalid_ref = Gitlab::Git::BRANCH_REF_PREFIX + "an_invalid_ref_\xE5" + + expect(described_class.ref_name(utf8_invalid_ref)).to eq("an_invalid_ref_å") + end + end end |