about summary refs log tree commit diff
path: root/spec/controllers/api/v1/trends/tags_controller_spec.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-02-25 00:34:14 +0100
committerGitHub <noreply@github.com>2022-02-25 00:34:14 +0100
commit27965ce5edff20db2de1dd233c88f8393bb0da0b (patch)
tree6714a950c1b9facc8c7bd1907e81e777257e5538 /spec/controllers/api/v1/trends/tags_controller_spec.rb
parenta29a982eaa0536a741b43ffb3397c74e3abe7196 (diff)
Add trending statuses (#17431)
* Add trending statuses

* Fix dangling items with stale scores in localized sets

* Various fixes and improvements

- Change approve_all/reject_all to approve_accounts/reject_accounts
- Change Trends::Query methods to not mutate the original query
- Change Trends::Query#skip to offset
- Change follow recommendations to be refreshed in a transaction

* Add tests for trending statuses filtering behaviour

* Fix not applying filtering scope in controller
Diffstat (limited to 'spec/controllers/api/v1/trends/tags_controller_spec.rb')
-rw-r--r--spec/controllers/api/v1/trends/tags_controller_spec.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/spec/controllers/api/v1/trends/tags_controller_spec.rb b/spec/controllers/api/v1/trends/tags_controller_spec.rb
index e2e26dcab..d29551c56 100644
--- a/spec/controllers/api/v1/trends/tags_controller_spec.rb
+++ b/spec/controllers/api/v1/trends/tags_controller_spec.rb
@@ -7,10 +7,9 @@ RSpec.describe Api::V1::Trends::TagsController, type: :controller do
 
   describe 'GET #index' do
     before do
-      trending_tags = double()
-
-      allow(trending_tags).to receive(:get).and_return(Fabricate.times(10, :tag))
-      allow(Trends).to receive(:tags).and_return(trending_tags)
+      Fabricate.times(10, :tag).each do |tag|
+        10.times { |i| Trends.tags.add(tag, i) }
+      end
 
       get :index
     end