mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
Fix links to uncategorized when SiteSetting.uncategorized_name is set
This commit is contained in:
parent
5d6ad8f39c
commit
1355c1e3b0
2 changed files with 17 additions and 5 deletions
|
@ -83,7 +83,9 @@ class ListController < ApplicationController
|
|||
end
|
||||
|
||||
def request_is_for_uncategorized?
|
||||
params[:category] == Slug.for(SiteSetting.uncategorized_name) || params[:category] == SiteSetting.uncategorized_name
|
||||
params[:category] == Slug.for(SiteSetting.uncategorized_name) ||
|
||||
params[:category] == SiteSetting.uncategorized_name ||
|
||||
params[:category] == 'uncategorized'
|
||||
end
|
||||
|
||||
def build_topic_list_options
|
||||
|
|
|
@ -85,10 +85,20 @@ describe ListController do
|
|||
response.should be_success
|
||||
end
|
||||
|
||||
it "responds with success when SiteSetting.uncategorized_name is non standard" do
|
||||
SiteSetting.uncategorized_name = "testing"
|
||||
xhr :get, :category, category: SiteSetting.uncategorized_name
|
||||
response.should be_success
|
||||
context 'SiteSetting.uncategorized_name is non standard' do
|
||||
before do
|
||||
SiteSetting.stubs(:uncategorized_name).returns('testing')
|
||||
end
|
||||
|
||||
it "responds with success given SiteSetting.uncategorized_name" do
|
||||
xhr :get, :category, category: SiteSetting.uncategorized_name
|
||||
response.should be_success
|
||||
end
|
||||
|
||||
it 'responds with success given "uncategorized"' do
|
||||
xhr :get, :category, category: 'uncategorized'
|
||||
response.should be_success
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue