From 7a281c477abacc4886e34a0e90ea0b1f489ceaf5 Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Tue, 30 May 2017 01:01:37 +0900 Subject: [PATCH] Cover Admin::PubSubHubHubController more (#3343) --- .../admin/pubsubhubbub_controller_spec.rb | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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