about summary refs log tree commit diff
path: root/spec/controllers/api/v1/followed_tags_controller_spec.rb
diff options
context:
space:
mode:
authorStarfall <us@starfall.systems>2022-07-25 18:53:31 -0500
committerStarfall <us@starfall.systems>2022-07-25 18:53:31 -0500
commit5b9419060d79eda85c40a12c567dd0e1e44a7ecb (patch)
treef5e21930844f7c11ae40b9097a78a32916ba5dba /spec/controllers/api/v1/followed_tags_controller_spec.rb
parenta137fecf94d25a03ef7224843c1afd0c30f428e6 (diff)
parent3a7c641dd4db1d67b172f731518b472d58dd2262 (diff)
Merge remote-tracking branch 'glitch/main'
Diffstat (limited to 'spec/controllers/api/v1/followed_tags_controller_spec.rb')
-rw-r--r--spec/controllers/api/v1/followed_tags_controller_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/controllers/api/v1/followed_tags_controller_spec.rb b/spec/controllers/api/v1/followed_tags_controller_spec.rb
new file mode 100644
index 000000000..2191350ef
--- /dev/null
+++ b/spec/controllers/api/v1/followed_tags_controller_spec.rb
@@ -0,0 +1,23 @@
+require 'rails_helper'
+
+RSpec.describe Api::V1::FollowedTagsController, type: :controller do
+  render_views
+
+  let(:user)   { Fabricate(:user) }
+  let(:scopes) { 'read:follows' }
+  let(:token)  { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: scopes) }
+
+  before { allow(controller).to receive(:doorkeeper_token) { token } }
+
+  describe 'GET #index' do
+    let!(:tag_follows) { Fabricate.times(5, :tag_follow, account: user.account) }
+
+    before do
+      get :index, params: { limit: 1 }
+    end
+
+    it 'returns http success' do
+      expect(response).to have_http_status(:success)
+    end
+  end
+end