diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-06-21 08:41:10 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-06-21 08:41:10 +0000 |
commit | 21465deef009f281c3619730e9c402d515c8f78d (patch) | |
tree | 0ce8fd7adb8fa161007f1050bb331b858860fb30 /spec/lib | |
parent | 3656f6cc4011ae75c740820a5c2ae70a4a5850c2 (diff) | |
parent | 218da88e1aa7b0538d069ce9dc6e3a4348c610fc (diff) | |
download | gitlab-ce-21465deef009f281c3619730e9c402d515c8f78d.tar.gz |
Merge branch 'gitaly-auth-token' into 'master'
Pass Gitaly token on Ruby gRPC requests
See merge request !12228
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/gitaly_client/commit_spec.rb | 8 | ||||
-rw-r--r-- | spec/lib/gitlab/gitaly_client/notifications_spec.rb | 2 | ||||
-rw-r--r-- | spec/lib/gitlab/gitaly_client/ref_spec.rb | 10 | ||||
-rw-r--r-- | spec/lib/gitlab/workhorse_spec.rb | 6 |
4 files changed, 15 insertions, 11 deletions
diff --git a/spec/lib/gitlab/gitaly_client/commit_spec.rb b/spec/lib/gitlab/gitaly_client/commit_spec.rb index cf1bc74779e..dff5b25c712 100644 --- a/spec/lib/gitlab/gitaly_client/commit_spec.rb +++ b/spec/lib/gitlab/gitaly_client/commit_spec.rb @@ -16,7 +16,7 @@ describe Gitlab::GitalyClient::Commit do right_commit_id: commit.id ) - expect_any_instance_of(Gitaly::Diff::Stub).to receive(:commit_diff).with(request) + expect_any_instance_of(Gitaly::Diff::Stub).to receive(:commit_diff).with(request, kind_of(Hash)) described_class.new(repository).diff_from_parent(commit) end @@ -31,7 +31,7 @@ describe Gitlab::GitalyClient::Commit do right_commit_id: initial_commit.id ) - expect_any_instance_of(Gitaly::Diff::Stub).to receive(:commit_diff).with(request) + expect_any_instance_of(Gitaly::Diff::Stub).to receive(:commit_diff).with(request, kind_of(Hash)) described_class.new(repository).diff_from_parent(initial_commit) end @@ -61,7 +61,7 @@ describe Gitlab::GitalyClient::Commit do right_commit_id: commit.id ) - expect_any_instance_of(Gitaly::Diff::Stub).to receive(:commit_delta).with(request).and_return([]) + expect_any_instance_of(Gitaly::Diff::Stub).to receive(:commit_delta).with(request, kind_of(Hash)).and_return([]) described_class.new(repository).commit_deltas(commit) end @@ -76,7 +76,7 @@ describe Gitlab::GitalyClient::Commit do right_commit_id: initial_commit.id ) - expect_any_instance_of(Gitaly::Diff::Stub).to receive(:commit_delta).with(request).and_return([]) + expect_any_instance_of(Gitaly::Diff::Stub).to receive(:commit_delta).with(request, kind_of(Hash)).and_return([]) described_class.new(repository).commit_deltas(initial_commit) end diff --git a/spec/lib/gitlab/gitaly_client/notifications_spec.rb b/spec/lib/gitlab/gitaly_client/notifications_spec.rb index e5c9e06a15e..c2b8ca9f501 100644 --- a/spec/lib/gitlab/gitaly_client/notifications_spec.rb +++ b/spec/lib/gitlab/gitaly_client/notifications_spec.rb @@ -9,7 +9,7 @@ describe Gitlab::GitalyClient::Notifications do it 'sends a post_receive message' do expect_any_instance_of(Gitaly::Notifications::Stub). - to receive(:post_receive).with(gitaly_request_with_path(storage_name, relative_path)) + to receive(:post_receive).with(gitaly_request_with_path(storage_name, relative_path), kind_of(Hash)) subject.post_receive end diff --git a/spec/lib/gitlab/gitaly_client/ref_spec.rb b/spec/lib/gitlab/gitaly_client/ref_spec.rb index 2ea44ef74b0..3272333bb33 100644 --- a/spec/lib/gitlab/gitaly_client/ref_spec.rb +++ b/spec/lib/gitlab/gitaly_client/ref_spec.rb @@ -21,7 +21,7 @@ describe Gitlab::GitalyClient::Ref do it 'sends a find_all_branch_names message' do expect_any_instance_of(Gitaly::Ref::Stub). to receive(:find_all_branch_names). - with(gitaly_request_with_path(storage_name, relative_path)). + with(gitaly_request_with_path(storage_name, relative_path), kind_of(Hash)). and_return([]) client.branch_names @@ -32,7 +32,7 @@ describe Gitlab::GitalyClient::Ref do it 'sends a find_all_tag_names message' do expect_any_instance_of(Gitaly::Ref::Stub). to receive(:find_all_tag_names). - with(gitaly_request_with_path(storage_name, relative_path)). + with(gitaly_request_with_path(storage_name, relative_path), kind_of(Hash)). and_return([]) client.tag_names @@ -43,7 +43,7 @@ describe Gitlab::GitalyClient::Ref do it 'sends a find_default_branch_name message' do expect_any_instance_of(Gitaly::Ref::Stub). to receive(:find_default_branch_name). - with(gitaly_request_with_path(storage_name, relative_path)). + with(gitaly_request_with_path(storage_name, relative_path), kind_of(Hash)). and_return(double(name: 'foo')) client.default_branch_name @@ -54,7 +54,7 @@ describe Gitlab::GitalyClient::Ref do it 'sends a find_local_branches message' do expect_any_instance_of(Gitaly::Ref::Stub). to receive(:find_local_branches). - with(gitaly_request_with_path(storage_name, relative_path)). + with(gitaly_request_with_path(storage_name, relative_path), kind_of(Hash)). and_return([]) client.local_branches @@ -63,7 +63,7 @@ describe Gitlab::GitalyClient::Ref do it 'parses and sends the sort parameter' do expect_any_instance_of(Gitaly::Ref::Stub). to receive(:find_local_branches). - with(gitaly_request_with_params(sort_by: :UPDATED_DESC)). + with(gitaly_request_with_params(sort_by: :UPDATED_DESC), kind_of(Hash)). and_return([]) client.local_branches(sort_by: 'updated_desc') diff --git a/spec/lib/gitlab/workhorse_spec.rb b/spec/lib/gitlab/workhorse_spec.rb index ad19998dff4..a3e8166cb70 100644 --- a/spec/lib/gitlab/workhorse_spec.rb +++ b/spec/lib/gitlab/workhorse_spec.rb @@ -202,7 +202,11 @@ describe Gitlab::Workhorse, lib: true do context 'when Gitaly is enabled' do let(:gitaly_params) do { - GitalyAddress: Gitlab::GitalyClient.address('default') + GitalyAddress: Gitlab::GitalyClient.address('default'), + GitalyServer: { + address: Gitlab::GitalyClient.address('default'), + token: Gitlab::GitalyClient.token('default') + } } end |