diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-09 09:09:00 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-09 09:09:00 +0300 |
commit | 7a544c9ef1136ce0b52e269f54ebe74d0f26ad3d (patch) | |
tree | eba4e16a960ed4cbdf144ce023e49597a67ab55a /spec/helpers | |
parent | 9627be559df06d4becd34a15972f11cadc588344 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/projects/topics_helper_spec.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/helpers/projects/topics_helper_spec.rb b/spec/helpers/projects/topics_helper_spec.rb new file mode 100644 index 00000000000..85720539828 --- /dev/null +++ b/spec/helpers/projects/topics_helper_spec.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Projects::TopicsHelper, feature_category: :groups_and_projects do + describe '#topic_explore_projects_cleaned_path' do + using RSpec::Parameterized::TableSyntax + + where(:topic_name, :expected_path) do + [ + %w[cat /explore/projects/topics/cat], + %w[cat🐈emoji /explore/projects/topics/cat%25F0%259F%2590%2588emoji], + %w[cat/mouse /explore/projects/topics/cat%252Fmouse], + ['cat space', '/explore/projects/topics/cat+space'] + ] + end + + with_them do + subject(:path) { topic_explore_projects_cleaned_path(topic_name: topic_name) } + + it { is_expected.to eq(expected_path) } + end + + context 'when explore_topics_cleaned_path feature flag is disabled' do + before do + stub_feature_flags(explore_topics_cleaned_path: false) + end + + it 'does no cleaning' do + expect(topic_explore_projects_cleaned_path(topic_name: 'cat/mouse')) + .to eq('/explore/projects/topics/cat%2Fmouse') + end + end + end +end |