mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Rename "Best Of" to "Summary"
This commit is contained in:
@@ -181,7 +181,7 @@ describe ComposerMessagesFinder do
|
||||
SiteSetting.stubs(:educate_until_posts).returns(10)
|
||||
user.stubs(:post_count).returns(11)
|
||||
|
||||
SiteSetting.stubs(:best_of_posts_required).returns(1)
|
||||
SiteSetting.stubs(:summary_posts_required).returns(1)
|
||||
|
||||
Fabricate(:post, topic: topic, user: user)
|
||||
Fabricate(:post, topic: topic, user: user)
|
||||
@@ -207,8 +207,8 @@ describe ComposerMessagesFinder do
|
||||
finder.check_dominating_topic.should be_blank
|
||||
end
|
||||
|
||||
it "does not notify if the `best_of_posts_required` has not been reached" do
|
||||
SiteSetting.stubs(:best_of_posts_required).returns(100)
|
||||
it "does not notify if the `summary_posts_required` has not been reached" do
|
||||
SiteSetting.stubs(:summary_posts_required).returns(100)
|
||||
finder.check_dominating_topic.should be_blank
|
||||
end
|
||||
|
||||
@@ -222,8 +222,8 @@ describe ComposerMessagesFinder do
|
||||
finder.check_dominating_topic.should be_present
|
||||
end
|
||||
|
||||
it "doesn't notify a user if the topic has less than `best_of_posts_required` posts" do
|
||||
SiteSetting.stubs(:best_of_posts_required).returns(5)
|
||||
it "doesn't notify a user if the topic has less than `summary_posts_required` posts" do
|
||||
SiteSetting.stubs(:summary_posts_required).returns(5)
|
||||
finder.check_dominating_topic.should be_blank
|
||||
end
|
||||
|
||||
|
||||
@@ -34,29 +34,29 @@ describe ScoreCalculator do
|
||||
|
||||
end
|
||||
|
||||
context 'best_of' do
|
||||
context 'summary' do
|
||||
|
||||
it "won't update the site settings when the site settings don't match" do
|
||||
ScoreCalculator.new(reads: 3).calculate
|
||||
topic.reload
|
||||
topic.has_best_of.should be_false
|
||||
topic.has_summary.should be_false
|
||||
end
|
||||
|
||||
it "removes the best_of flag if the topic no longer qualifies" do
|
||||
topic.update_column(:has_best_of, true)
|
||||
it "removes the summary flag if the topic no longer qualifies" do
|
||||
topic.update_column(:has_summary, true)
|
||||
ScoreCalculator.new(reads: 3).calculate
|
||||
topic.reload
|
||||
topic.has_best_of.should be_false
|
||||
topic.has_summary.should be_false
|
||||
end
|
||||
|
||||
it "won't update the site settings when the site settings don't match" do
|
||||
SiteSetting.expects(:best_of_likes_required).returns(0)
|
||||
SiteSetting.expects(:best_of_posts_required).returns(1)
|
||||
SiteSetting.expects(:best_of_score_threshold).returns(100)
|
||||
SiteSetting.expects(:summary_likes_required).returns(0)
|
||||
SiteSetting.expects(:summary_posts_required).returns(1)
|
||||
SiteSetting.expects(:summary_score_threshold).returns(100)
|
||||
|
||||
ScoreCalculator.new(reads: 3).calculate
|
||||
topic.reload
|
||||
topic.has_best_of.should be_true
|
||||
topic.has_summary.should be_true
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -701,14 +701,14 @@ describe Post do
|
||||
|
||||
end
|
||||
|
||||
context 'best_of' do
|
||||
context 'summary' do
|
||||
let!(:p1) { Fabricate(:post, post_args.merge(score: 4, percent_rank: 0.33)) }
|
||||
let!(:p2) { Fabricate(:post, post_args.merge(score: 10, percent_rank: 0.66)) }
|
||||
let!(:p3) { Fabricate(:post, post_args.merge(score: 5, percent_rank: 0.99)) }
|
||||
|
||||
it "returns the OP and posts above the threshold in best of mode" do
|
||||
SiteSetting.stubs(:best_of_percent_filter).returns(66)
|
||||
Post.best_of.order(:post_number).should == [p1, p2]
|
||||
it "returns the OP and posts above the threshold in summary mode" do
|
||||
SiteSetting.stubs(:summary_percent_filter).returns(66)
|
||||
Post.summary.order(:post_number).should == [p1, p2]
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -712,7 +712,7 @@ describe Topic do
|
||||
|
||||
it 'is a regular topic by default' do
|
||||
topic.archetype.should == Archetype.default
|
||||
topic.has_best_of.should be_false
|
||||
topic.has_summary.should be_false
|
||||
topic.percent_rank.should == 1.0
|
||||
topic.should be_visible
|
||||
topic.pinned_at.should be_blank
|
||||
|
||||
Reference in New Issue
Block a user