summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/gitaly_client
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-06-10 20:50:00 -0700
committerStan Hu <stanhu@gmail.com>2019-06-10 20:50:00 -0700
commitdf650eaae5f94357f155c9b35c51a6b8c98fb6d7 (patch)
treecd36f7c33d3e4ceaa156c59bb6fda46e4dab3900 /spec/lib/gitlab/gitaly_client
parent1edf1807c570d74ee0039f5f58ef607ee797187a (diff)
downloadgitlab-ce-df650eaae5f94357f155c9b35c51a6b8c98fb6d7.tar.gz
Force source and target branch to binary modesh-fix-utf-8-encoding-resolve-conflicts
Diffstat (limited to 'spec/lib/gitlab/gitaly_client')
-rw-r--r--spec/lib/gitlab/gitaly_client/conflicts_service_spec.rb23
1 files changed, 15 insertions, 8 deletions
diff --git a/spec/lib/gitlab/gitaly_client/conflicts_service_spec.rb b/spec/lib/gitlab/gitaly_client/conflicts_service_spec.rb
index a8a6830ee2d..52630ba0223 100644
--- a/spec/lib/gitlab/gitaly_client/conflicts_service_spec.rb
+++ b/spec/lib/gitlab/gitaly_client/conflicts_service_spec.rb
@@ -51,16 +51,23 @@ describe Gitlab::GitalyClient::ConflictsService do
subject
end
- it 'handles commit messages with UTF-8 characters' do
- allow(::Gitlab::GitalyClient).to receive(:call).and_call_original
- expect(::Gitlab::GitalyClient).to receive(:call).with(anything, :conflicts_service, :resolve_conflicts, any_args) do |*args|
- # Force the generation of request messages by iterating through the enumerator
- args[3].to_a
+ context 'with branches with UTF-8 characters' do
+ let(:source_branch) { 'testòbranch' }
+ let(:target_branch) { 'ábranch' }
- double(resolution_error: nil)
- end
+ it 'handles commit messages with UTF-8 characters' do
+ allow(::Gitlab::GitalyClient).to receive(:call).and_call_original
+ expect(::Gitlab::GitalyClient).to receive(:call).with(anything, :conflicts_service, :resolve_conflicts, any_args) do |*args|
+ # Force the generation of request messages by iterating through the enumerator
+ message = args[3].to_a.first
+ params = [message.header.commit_message, message.header.source_branch, message.header.target_branch]
+ expect(params.map(&:encoding).uniq).to eq([Encoding::ASCII_8BIT])
- subject
+ double(resolution_error: nil)
+ end
+
+ subject
+ end
end
it 'raises a relevant exception if resolution_error is present' do