summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/default_branch_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-05-19 15:44:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-05-19 15:44:42 +0000
commit4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch)
tree5423a1c7516cffe36384133ade12572cf709398d /spec/lib/gitlab/default_branch_spec.rb
parente570267f2f6b326480d284e0164a6464ba4081bc (diff)
downloadgitlab-ce-4555e1b21c365ed8303ffb7a3325d773c9b8bf31.tar.gz
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
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