2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-05 08:59:27 +08:00

Category Topics are no longer invisible, they are pinned.

This commit is contained in:
Robin Ward 2013-03-07 12:45:49 -05:00
parent c7359145aa
commit 052887c296
4 changed files with 16 additions and 9 deletions

View file

@ -72,7 +72,7 @@ describe CategoryList do
end
it "should contain our topic" do
category.featured_topics.should == [topic]
category.featured_topics.include?(topic).should be_true
end
end

View file

@ -47,6 +47,7 @@ describe TopicQuery do
context 'categorized' do
let(:category) { Fabricate(:category) }
let(:topic_category) { category.topic }
let!(:topic_no_cat) { Fabricate(:topic) }
let!(:topic_in_cat) { Fabricate(:topic, category: category) }
@ -55,16 +56,17 @@ describe TopicQuery do
end
it "returns the topic with a category when filtering by category" do
topic_query.list_category(category).topics.should == [topic_in_cat]
topic_query.list_category(category).topics.should == [topic_category, topic_in_cat]
end
it "returns nothing when filtering by another category" do
topic_query.list_category(Fabricate(:category, name: 'new cat')).topics.should be_blank
it "returns only the topic category when filtering by another category" do
another_category = Fabricate(:category, name: 'new cat')
topic_query.list_category(another_category).topics.should == [another_category.topic]
end
describe '#list_new_in_category' do
it 'returns only the categorized topic' do
topic_query.list_new_in_category(category).topics.should == [topic_in_cat]
it 'returns the topic category and the categorized topic' do
topic_query.list_new_in_category(category).topics.should == [topic_in_cat, topic_category]
end
end
end

View file

@ -99,8 +99,12 @@ describe Category do
@topic.category.should == @category
end
it 'is an invisible topic' do
@topic.should_not be_visible
it 'is a visible topic' do
@topic.should be_visible
end
it 'is pinned' do
@topic.pinned_at.should be_present
end
it 'is an undeletable topic' do