summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-01-25 09:16:18 +0000
committerRémy Coutable <remy@rymai.me>2018-01-25 09:16:18 +0000
commit567b3826a99e5573f4db7c033ce59cbf0fd640c7 (patch)
tree09804ea3d7d18b9b7a6d26a411bba5aa4306bf67 /spec
parentaff9ecefb8a2c0e3b6816a4632c8433940dd6e88 (diff)
parentb33e7281ffef39058bcef4e741060a703cfaf02e (diff)
downloadgitlab-ce-567b3826a99e5573f4db7c033ce59cbf0fd640c7.tar.gz
Merge branch '42161-gitaly-commitservice-encoding-undefinedconversionerror-u-c124-from-utf-8-to-ascii-8bit' into 'master'
Resolve "Gitaly::CommitService: Encoding::UndefinedConversionError: U+C124 from UTF-8 to ASCII-8BIT" Closes #42161 See merge request gitlab-org/gitlab-ce!16637
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/gitaly_client/commit_service_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/lib/gitlab/gitaly_client/commit_service_spec.rb b/spec/lib/gitlab/gitaly_client/commit_service_spec.rb
index b2275119a04..3722a91c050 100644
--- a/spec/lib/gitlab/gitaly_client/commit_service_spec.rb
+++ b/spec/lib/gitlab/gitaly_client/commit_service_spec.rb
@@ -131,6 +131,29 @@ describe Gitlab::GitalyClient::CommitService do
end
end
+ describe '#commit_count' do
+ before do
+ expect_any_instance_of(Gitaly::CommitService::Stub)
+ .to receive(:count_commits)
+ .with(gitaly_request_with_path(storage_name, relative_path),
+ kind_of(Hash))
+ .and_return([])
+ end
+
+ it 'sends a commit_count message' do
+ client.commit_count(revision)
+ end
+
+ context 'with UTF-8 params strings' do
+ let(:revision) { "branch\u011F" }
+ let(:path) { "foo/\u011F.txt" }
+
+ it 'handles string encodings correctly' do
+ client.commit_count(revision, path: path)
+ end
+ end
+ end
+
describe '#find_commit' do
let(:revision) { '4b825dc642cb6eb9a060e54bf8d69288fbee4904' }
it 'sends an RPC request' do