Rename "Best Of" to "Summary"

This commit is contained in:
Robin Ward
2013-11-18 12:48:26 -05:00
parent 34e451ef25
commit 4ce81e1b01
61 changed files with 212 additions and 227 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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