summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorAlejandro Rodríguez <alejorro70@gmail.com>2017-08-21 15:13:40 -0300
committerAlejandro Rodríguez <alejorro70@gmail.com>2017-08-21 15:13:40 -0300
commitb7ebb447d7a0f8e65c791d4f7af6e042b72ff644 (patch)
treec3286f70c8a108cb58e71e2143cbfbb71793a9f6 /spec
parent646aae3e4f0f9c547397fdf55cc2205b0171b565 (diff)
downloadgitlab-ce-b7ebb447d7a0f8e65c791d4f7af6e042b72ff644.tar.gz
Correctly encode string params for Gitaly's TreeEntries RPCgitaly-tree-entries-encoding
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/gitaly_client/commit_service_spec.rb14
1 files changed, 14 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 7fe698fcb18..2eaf4222964 100644
--- a/spec/lib/gitlab/gitaly_client/commit_service_spec.rb
+++ b/spec/lib/gitlab/gitaly_client/commit_service_spec.rb
@@ -111,6 +111,20 @@ describe Gitlab::GitalyClient::CommitService do
client.tree_entries(repository, revision, path)
end
+
+ context 'with UTF-8 params strings' do
+ let(:revision) { "branch\u011F" }
+ let(:path) { "foo/\u011F.txt" }
+
+ it 'handles string encodings correctly' do
+ expect_any_instance_of(Gitaly::CommitService::Stub)
+ .to receive(:get_tree_entries)
+ .with(gitaly_request_with_path(storage_name, relative_path), kind_of(Hash))
+ .and_return([])
+
+ client.tree_entries(repository, revision, path)
+ end
+ end
end
describe '#find_commit' do