Merge remote-tracking branch 'parent/main' into upstream-20241206

This commit is contained in:
KMY 2024-12-06 12:17:45 +09:00
commit 3c3ee557d0
187 changed files with 1105 additions and 537 deletions

View file

@ -0,0 +1,11 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe TagTrend do
include_examples 'RankedTrend'
describe 'Associations' do
it { is_expected.to belong_to(:tag).required }
end
end

View file

@ -88,10 +88,10 @@ RSpec.describe Trends::Tags do
it 'decays scores' do
subject.refresh(yesterday + 12.hours)
original_score = subject.score(tag_ocs.id)
original_score = TagTrend.find_by(tag: tag_ocs).score
expect(original_score).to eq 144.0
subject.refresh(yesterday + 12.hours + subject.options[:max_score_halflife])
decayed_score = subject.score(tag_ocs.id)
decayed_score = TagTrend.find_by(tag: tag_ocs).score
expect(decayed_score).to be <= original_score / 2
end
end