From f6f0fcc8e3f5c880ea25fc567e894c915e712f6c Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Tue, 8 Oct 2019 02:38:13 +0200 Subject: [PATCH] DEV: attemps to male top-topic-spec more resilient (#8168) --- spec/models/top_topic_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/models/top_topic_spec.rb b/spec/models/top_topic_spec.rb index 1d49694bca..720b392900 100644 --- a/spec/models/top_topic_spec.rb +++ b/spec/models/top_topic_spec.rb @@ -73,8 +73,8 @@ describe TopTopic do top_topics = TopTopic.all expect(top_topics.where(topic_id: topic_1.id).pluck(:yearly_score).first).to eq(27) - expect(top_topics.where(topic_id: topic_2.id).pluck(:yearly_score).first).to eq(18.301029995664) - expect(top_topics.where(topic_id: topic_3.id).pluck(:yearly_score).first).to eq(10.602059991328) + expect(top_topics.where(topic_id: topic_2.id).pluck(:yearly_score).first).to be_within(0.0000000001).of(18.301029995664) + expect(top_topics.where(topic_id: topic_3.id).pluck(:yearly_score).first).to be_within(0.0000000001).of(10.602059991328) # when 'top_topics_formula_log_views_multiplier' setting is changed SiteSetting.top_topics_formula_log_views_multiplier = 4