diff --git a/app/serializers/reviewable_score_serializer.rb b/app/serializers/reviewable_score_serializer.rb index 6a0eac38d0a..5a4d1f05ded 100644 --- a/app/serializers/reviewable_score_serializer.rb +++ b/app/serializers/reviewable_score_serializer.rb @@ -72,7 +72,7 @@ class ReviewableScoreSerializer < ApplicationSerializer when 'watched_word' "#{Discourse.base_url}/admin/customize/watched_words" when 'category' - "#{Discourse.base_url}/c/#{object.reviewable.category&.name}/edit/settings" + "#{Discourse.base_url}/c/#{object.reviewable.category&.slug}/edit/settings" else "#{Discourse.base_url}/admin/site_settings/category/all_results?filter=#{text}" end diff --git a/spec/fabricators/category_fabricator.rb b/spec/fabricators/category_fabricator.rb index 0e14967af41..3793bb118ee 100644 --- a/spec/fabricators/category_fabricator.rb +++ b/spec/fabricators/category_fabricator.rb @@ -2,6 +2,7 @@ Fabricator(:category) do name { sequence(:name) { |n| "Amazing Category #{n}" } } + slug { sequence(:slug) { |n| "amazing-category-#{n}" } } skip_category_definition true user end diff --git a/spec/serializers/reviewable_score_serializer_spec.rb b/spec/serializers/reviewable_score_serializer_spec.rb index 1a52cbe9a8f..4b58979493f 100644 --- a/spec/serializers/reviewable_score_serializer_spec.rb +++ b/spec/serializers/reviewable_score_serializer_spec.rb @@ -18,7 +18,7 @@ RSpec.describe ReviewableScoreSerializer do category = Fabricate.build(:category) reviewable.category = category serialized = serialized_score('category') - link_url = "#{Discourse.base_url}/c/#{category.name}/edit/settings" + link_url = "#{Discourse.base_url}/c/#{category.slug}/edit/settings" category_link = "#{I18n.t('reviewables.reasons.links.category')}" expect(serialized.reason).to include(category_link)