diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-05 16:54:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-05 16:54:15 +0300 |
commit | be834a25982746ffd85252ff502df42bb88cb9d5 (patch) | |
tree | b4d6a8ba0931e12fac08f05abea33a3b8ec2c8a2 /spec/helpers/search_helper_spec.rb | |
parent | ee925a3597f27e92f83a50937a64068109675b3d (diff) |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc32
Diffstat (limited to 'spec/helpers/search_helper_spec.rb')
-rw-r--r-- | spec/helpers/search_helper_spec.rb | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/spec/helpers/search_helper_spec.rb b/spec/helpers/search_helper_spec.rb index 594c5c11994..341606635c0 100644 --- a/spec/helpers/search_helper_spec.rb +++ b/spec/helpers/search_helper_spec.rb @@ -357,14 +357,6 @@ RSpec.describe SearchHelper do describe '#show_user_search_tab?' do subject { show_user_search_tab? } - context 'when users_search feature is disabled' do - before do - stub_feature_flags(users_search: false) - end - - it { is_expected.to eq(false) } - end - context 'when project search' do before do @project = :some_project @@ -399,4 +391,25 @@ RSpec.describe SearchHelper do end end end + + describe '#repository_ref' do + let_it_be(:project) { create(:project, :repository) } + let(:params) { { repository_ref: 'the-repository-ref-param' } } + + subject { repository_ref(project) } + + it { is_expected.to eq('the-repository-ref-param') } + + context 'when the param :repository_ref is not set' do + let(:params) { { repository_ref: nil } } + + it { is_expected.to eq(project.default_branch) } + end + + context 'when the repository_ref param is a number' do + let(:params) { { repository_ref: 111111 } } + + it { is_expected.to eq('111111') } + end + end end |