about summary refs log tree commit diff
path: root/spec/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/admin/pubsubhubbub_controller_spec.rb17
1 files changed, 16 insertions, 1 deletions
diff --git a/spec/controllers/admin/pubsubhubbub_controller_spec.rb b/spec/controllers/admin/pubsubhubbub_controller_spec.rb
index c2bab5dac..c8e8e7a84 100644
--- a/spec/controllers/admin/pubsubhubbub_controller_spec.rb
+++ b/spec/controllers/admin/pubsubhubbub_controller_spec.rb
@@ -5,12 +5,27 @@ RSpec.describe Admin::PubsubhubbubController, type: :controller do
   render_views
 
   describe 'GET #index' do
+    around do |example|
+      default_per_page = Subscription.default_per_page
+      Subscription.paginates_per 1
+      example.run
+      Subscription.paginates_per default_per_page
+    end
+
     before do
       sign_in Fabricate(:user, admin: true), scope: :user
     end
 
-    it 'returns http success' do
+    it 'renders subscriptions' do
+      Fabricate(:subscription)
+      specified = Fabricate(:subscription)
+
       get :index
+
+      subscriptions = assigns(:subscriptions)
+      expect(subscriptions.count).to eq 1
+      expect(subscriptions[0]).to eq specified
+
       expect(response).to have_http_status(:success)
     end
   end