0
0
Fork 0

Fix RSpec/DescribedClass cop (#29472)

This commit is contained in:
Matt Jankowski 2024-03-13 11:42:39 -04:00 committed by GitHub
parent c09b8a7164
commit 6262ceeb70
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 29 additions and 29 deletions

View file

@ -11,7 +11,7 @@ RSpec.describe FeedManager do
end
it 'tracks at least as many statuses as reblogs', :skip_stub do
expect(FeedManager::REBLOG_FALLOFF).to be <= FeedManager::MAX_ITEMS
expect(described_class::REBLOG_FALLOFF).to be <= described_class::MAX_ITEMS
end
describe '#key' do
@ -225,12 +225,12 @@ RSpec.describe FeedManager do
it 'trims timelines if they will have more than FeedManager::MAX_ITEMS' do
account = Fabricate(:account)
status = Fabricate(:status)
members = Array.new(FeedManager::MAX_ITEMS) { |count| [count, count] }
members = Array.new(described_class::MAX_ITEMS) { |count| [count, count] }
redis.zadd("feed:home:#{account.id}", members)
described_class.instance.push_to_home(account, status)
expect(redis.zcard("feed:home:#{account.id}")).to eq FeedManager::MAX_ITEMS
expect(redis.zcard("feed:home:#{account.id}")).to eq described_class::MAX_ITEMS
end
context 'with reblogs' do
@ -260,7 +260,7 @@ RSpec.describe FeedManager do
described_class.instance.push_to_home(account, reblogged)
# Fill the feed with intervening statuses
FeedManager::REBLOG_FALLOFF.times do
described_class::REBLOG_FALLOFF.times do
described_class.instance.push_to_home(account, Fabricate(:status))
end
@ -321,7 +321,7 @@ RSpec.describe FeedManager do
described_class.instance.push_to_home(account, reblogs.first)
# Fill the feed with intervening statuses
FeedManager::REBLOG_FALLOFF.times do
described_class::REBLOG_FALLOFF.times do
described_class.instance.push_to_home(account, Fabricate(:status))
end
@ -467,7 +467,7 @@ RSpec.describe FeedManager do
status = Fabricate(:status, reblog: reblogged)
described_class.instance.push_to_home(receiver, reblogged)
FeedManager::REBLOG_FALLOFF.times { described_class.instance.push_to_home(receiver, Fabricate(:status)) }
described_class::REBLOG_FALLOFF.times { described_class.instance.push_to_home(receiver, Fabricate(:status)) }
described_class.instance.push_to_home(receiver, status)
# The reblogging status should show up under normal conditions.