FEATURE: reorder participants in topic so always chronological

FEATURE: tie breaker for same number of posts is last post date
UX: highlight for latest poster when it is OP
This commit is contained in:
Sam
2015-04-06 17:27:05 +10:00
parent 0fcb98c80a
commit c6a5081763
7 changed files with 33 additions and 43 deletions

View File

@@ -291,7 +291,7 @@ describe PostDestroyer do
let!(:post) { Fabricate(:post, raw: "Hello @CodingHorror") }
it "should feature the users again (in case they've changed)" do
Jobs.expects(:enqueue).with(:feature_topic_users, has_entries(topic_id: post.topic_id, except_post_id: post.id))
Jobs.expects(:enqueue).with(:feature_topic_users, has_entries(topic_id: post.topic_id))
PostDestroyer.new(moderator, post).destroy
end

View File

@@ -30,11 +30,6 @@ describe Jobs::FeatureTopicUsers do
expect(topic.reload.featured_user_ids.include?(coding_horror.id)).to eq(true)
end
it "will not feature the second poster if we supply their post to be ignored" do
Jobs::FeatureTopicUsers.new.execute(topic_id: topic.id, except_post_id: second_post.id)
expect(topic.reload.featured_user_ids.include?(coding_horror.id)).to eq(false)
end
it "won't feature the last poster" do
Jobs::FeatureTopicUsers.new.execute(topic_id: topic.id)
expect(topic.reload.featured_user_ids.include?(evil_trout.id)).to eq(false)