mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FEATURE: new category setting for whether to show latest topics or top topics by default
This commit is contained in:
parent
bcf634ca85
commit
6aab8cb331
12 changed files with 74 additions and 13 deletions
|
@ -141,7 +141,6 @@ describe ListController do
|
|||
|
||||
it { is_expected.not_to respond_with(:success) }
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
describe 'feed' do
|
||||
|
@ -151,6 +150,29 @@ describe ListController do
|
|||
expect(response.content_type).to eq('application/rss+xml')
|
||||
end
|
||||
end
|
||||
|
||||
describe "category default views" do
|
||||
it "top default view" do
|
||||
category.update_attributes!(default_view: 'top')
|
||||
described_class.expects(:best_period_for).returns('yearly')
|
||||
xhr :get, :category_default, category: category.slug
|
||||
expect(response).to be_success
|
||||
end
|
||||
|
||||
it "default view is nil" do
|
||||
category.update_attributes!(default_view: nil)
|
||||
described_class.expects(:best_period_for).never
|
||||
xhr :get, :category_default, category: category.slug
|
||||
expect(response).to be_success
|
||||
end
|
||||
|
||||
it "default view is latest" do
|
||||
category.update_attributes!(default_view: 'latest')
|
||||
described_class.expects(:best_period_for).never
|
||||
xhr :get, :category_default, category: category.slug
|
||||
expect(response).to be_success
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue