diff options
Diffstat (limited to 'spec/support/shared_contexts/controllers/ambiguous_ref_controller_shared_context.rb')
-rw-r--r-- | spec/support/shared_contexts/controllers/ambiguous_ref_controller_shared_context.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/support/shared_contexts/controllers/ambiguous_ref_controller_shared_context.rb b/spec/support/shared_contexts/controllers/ambiguous_ref_controller_shared_context.rb new file mode 100644 index 00000000000..8ad7edee1a1 --- /dev/null +++ b/spec/support/shared_contexts/controllers/ambiguous_ref_controller_shared_context.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +RSpec.shared_context 'with ambiguous refs for controllers' do + let(:ambiguous_ref_modal) { false } + + before do + expect(::Gitlab::GitalyClient).to receive(:allow_ref_name_caching).and_call_original # rubocop:disable RSpec/ExpectInHook + project.repository.add_tag(project.creator, 'ambiguous_ref', RepoHelpers.sample_commit.id) + project.repository.add_branch(project.creator, 'ambiguous_ref', RepoHelpers.another_sample_commit.id) + + stub_feature_flags(redirect_with_ref_type: redirect_with_ref_type) + stub_feature_flags(ambiguous_ref_modal: ambiguous_ref_modal) + end + + after do + project.repository.rm_tag(project.creator, 'ambiguous_ref') + project.repository.rm_branch(project.creator, 'ambiguous_ref') + end +end |