From 0923d23789238dbc9de757549e562a5c3945cfd7 Mon Sep 17 00:00:00 2001 From: abcang Date: Wed, 21 Feb 2018 00:50:12 +0900 Subject: [PATCH] Improve performance of feed_manager_spec (#6517) --- spec/lib/feed_manager_spec.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/spec/lib/feed_manager_spec.rb b/spec/lib/feed_manager_spec.rb index f2103a4b13..c6bc388e05 100644 --- a/spec/lib/feed_manager_spec.rb +++ b/spec/lib/feed_manager_spec.rb @@ -1,7 +1,14 @@ require 'rails_helper' RSpec.describe FeedManager do - it 'tracks at least as many statuses as reblogs' do + before do |example| + unless example.metadata[:skip_stub] + stub_const 'FeedManager::MAX_ITEMS', 10 + stub_const 'FeedManager::REBLOG_FALLOFF', 4 + end + end + + it 'tracks at least as many statuses as reblogs', skip_stub: true do expect(FeedManager::REBLOG_FALLOFF).to be <= FeedManager::MAX_ITEMS end