2017-02-05 13:04:23 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-07-18 03:59:36 -04:00
|
|
|
describe Gitlab::GitalyClient::NotificationService do
|
2017-02-05 13:04:23 -05:00
|
|
|
describe '#post_receive' do
|
2017-08-02 15:55:11 -04:00
|
|
|
let(:project) { create(:project) }
|
2017-06-12 17:37:43 -04:00
|
|
|
let(:storage_name) { project.repository_storage }
|
2017-07-21 00:13:26 -04:00
|
|
|
let(:relative_path) { project.disk_path + '.git' }
|
2017-04-07 05:19:20 -04:00
|
|
|
subject { described_class.new(project.repository) }
|
2017-02-15 21:08:30 -05:00
|
|
|
|
2017-02-05 13:04:23 -05:00
|
|
|
it 'sends a post_receive message' do
|
2017-07-18 03:59:36 -04:00
|
|
|
expect_any_instance_of(Gitaly::NotificationService::Stub)
|
2017-06-21 09:48:12 -04:00
|
|
|
.to receive(:post_receive).with(gitaly_request_with_path(storage_name, relative_path), kind_of(Hash))
|
2017-02-05 13:04:23 -05:00
|
|
|
|
2017-02-15 21:08:30 -05:00
|
|
|
subject.post_receive
|
2017-02-05 13:04:23 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|