From 114cc1c8510fc3fbd677f5bbfc0be6ae86877267 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Wed, 7 Jan 2015 11:45:57 -0500 Subject: [PATCH] FIX: We missed some references to `/category/xyz` in the ruby code base. --- app/models/category.rb | 2 +- app/views/topics/show.html.erb | 2 +- spec/components/topic_query_spec.rb | 2 +- spec/models/category_spec.rb | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/models/category.rb b/app/models/category.rb index 3535019b76b..0af7e22f9b5 100644 --- a/app/models/category.rb +++ b/app/models/category.rb @@ -369,7 +369,7 @@ SQL def url url = @@url_cache[self.id] unless url - url = "/category" + url = "/c" url << "/#{parent_category.slug}" if parent_category_id url << "/#{slug}" url.freeze diff --git a/app/views/topics/show.html.erb b/app/views/topics/show.html.erb index 9bdda7085aa..42421fb7b88 100644 --- a/app/views/topics/show.html.erb +++ b/app/views/topics/show.html.erb @@ -2,7 +2,7 @@ <%= render_topic_title(@topic_view.topic) %> <% if c = @topic_view.topic.category %> - <%= c.name %> + <%= link_to c.name, c.url %> <% end %>
diff --git a/spec/components/topic_query_spec.rb b/spec/components/topic_query_spec.rb index 74215acf3a5..f9f2dd7348c 100644 --- a/spec/components/topic_query_spec.rb +++ b/spec/components/topic_query_spec.rb @@ -84,7 +84,7 @@ describe TopicQuery do list = TopicQuery.new(moderator, category: diff_category.slug).list_latest list.topics.size.should == 1 - list.preload_key.should == "topic_list_category/different-category/l/latest" + list.preload_key.should == "topic_list_c/different-category/l/latest" # Defaults to no category filter when slug does not exist TopicQuery.new(moderator, category: 'made up slug').list_latest.topics.size.should == 2 diff --git a/spec/models/category_spec.rb b/spec/models/category_spec.rb index 7c9feaed838..3b4d2cd7849 100644 --- a/spec/models/category_spec.rb +++ b/spec/models/category_spec.rb @@ -441,7 +441,7 @@ describe Category do describe "#url" do it "builds a url for normal categories" do category = Fabricate(:category, name: "cats") - expect(category.url).to eq "/category/cats" + expect(category.url).to eq "/c/cats" end describe "for subcategories" do @@ -449,7 +449,7 @@ describe Category do parent_category = Fabricate(:category, name: "parent") subcategory = Fabricate(:category, name: "child", parent_category_id: parent_category.id) - expect(subcategory.url).to eq "/category/parent/child" + expect(subcategory.url).to eq "/c/parent/child" end end end