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:
Diffstat (limited to 'spec/services/git')
-rw-r--r--spec/services/git/base_hooks_service_spec.rb17
-rw-r--r--spec/services/git/branch_hooks_service_spec.rb1
-rw-r--r--spec/services/git/tag_hooks_service_spec.rb1
3 files changed, 18 insertions, 1 deletions
diff --git a/spec/services/git/base_hooks_service_spec.rb b/spec/services/git/base_hooks_service_spec.rb
index 8a686a19c4c..60883db0cd5 100644
--- a/spec/services/git/base_hooks_service_spec.rb
+++ b/spec/services/git/base_hooks_service_spec.rb
@@ -102,10 +102,25 @@ RSpec.describe Git::BaseHooksService, feature_category: :source_code_management
it 'executes the services' do
expect(subject).to receive(:push_data).at_least(:once).and_call_original
- expect(project).to receive(:execute_integrations)
+ expect(project).to receive(:execute_integrations).with(kind_of(Hash), subject.hook_name, skip_ci: false)
subject.execute
end
+
+ context 'with integrations.skip_ci push option' do
+ before do
+ params[:push_options] = {
+ integrations: { skip_ci: true }
+ }
+ end
+
+ it 'executes the services' do
+ expect(subject).to receive(:push_data).at_least(:once).and_call_original
+ expect(project).to receive(:execute_integrations).with(kind_of(Hash), subject.hook_name, skip_ci: true)
+
+ subject.execute
+ end
+ end
end
context 'with inactive integrations' do
diff --git a/spec/services/git/branch_hooks_service_spec.rb b/spec/services/git/branch_hooks_service_spec.rb
index f567624068a..3050d6c5eca 100644
--- a/spec/services/git/branch_hooks_service_spec.rb
+++ b/spec/services/git/branch_hooks_service_spec.rb
@@ -29,6 +29,7 @@ RSpec.describe Git::BranchHooksService, :clean_gitlab_redis_shared_state, featur
before: oldrev,
after: newrev,
ref: ref,
+ ref_protected: project.protected_for?(ref),
user_id: user.id,
user_name: user.name,
project_id: project.id
diff --git a/spec/services/git/tag_hooks_service_spec.rb b/spec/services/git/tag_hooks_service_spec.rb
index 73f6eff36ba..3e06443126b 100644
--- a/spec/services/git/tag_hooks_service_spec.rb
+++ b/spec/services/git/tag_hooks_service_spec.rb
@@ -63,6 +63,7 @@ RSpec.describe Git::TagHooksService, :service, feature_category: :source_code_ma
is_expected.to match a_hash_including(
object_kind: 'tag_push',
ref: ref,
+ ref_protected: project.protected_for?(ref),
before: oldrev,
after: newrev,
message: tag.message,