Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-07-19 17:16:28 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-07-19 17:16:28 +0300
commite4384360a16dd9a19d4d2d25d0ef1f2b862ed2a6 (patch)
tree2fcdfa7dcdb9db8f5208b2562f4b4e803d671243 /gems/click_house-client/spec/click_house/client/database_spec.rb
parentffda4e7bcac36987f936b4ba515995a6698698f0 (diff)
Add latest changes from gitlab-org/gitlab@16-2-stable-eev16.2.0-rc42
Diffstat (limited to 'gems/click_house-client/spec/click_house/client/database_spec.rb')
-rw-r--r--gems/click_house-client/spec/click_house/client/database_spec.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/gems/click_house-client/spec/click_house/client/database_spec.rb b/gems/click_house-client/spec/click_house/client/database_spec.rb
new file mode 100644
index 00000000000..112b2ee12b1
--- /dev/null
+++ b/gems/click_house-client/spec/click_house/client/database_spec.rb
@@ -0,0 +1,32 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe ClickHouse::Client::Database do
+ subject(:database) do
+ described_class.new(
+ database: 'test_db',
+ url: 'http://localhost:3333',
+ username: 'user',
+ password: 'pass',
+ variables: {
+ join_use_nulls: 1
+ }
+ )
+ end
+
+ describe '#uri' do
+ it 'builds the correct URL' do
+ expect(database.uri.to_s).to eq('http://localhost:3333?database=test_db&join_use_nulls=1')
+ end
+ end
+
+ describe '#headers' do
+ it 'returns the correct headers' do
+ expect(database.headers).to eq({
+ 'X-ClickHouse-User' => 'user',
+ 'X-ClickHouse-Key' => 'pass'
+ })
+ end
+ end
+end