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/lib/gitlab/default_branch_spec.rb')
-rw-r--r--spec/lib/gitlab/default_branch_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/lib/gitlab/default_branch_spec.rb b/spec/lib/gitlab/default_branch_spec.rb
new file mode 100644
index 00000000000..b066815612c
--- /dev/null
+++ b/spec/lib/gitlab/default_branch_spec.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+# We disabled main_branch_over_master feature for tests
+# In order to have consistent branch usages
+# When we migrate the branch name to main, we can enable it
+RSpec.describe Gitlab::DefaultBranch do
+ context 'main_branch_over_master is enabled' do
+ before do
+ stub_feature_flags(main_branch_over_master: true)
+ end
+
+ it 'returns main' do
+ expect(described_class.value).to eq('main')
+ end
+ end
+
+ context 'main_branch_over_master is disabled' do
+ it 'returns master' do
+ expect(described_class.value).to eq('master')
+ end
+ end
+end