diff options
author | Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp> | 2017-05-30 01:01:37 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-05-29 18:01:37 +0200 |
commit | 7a281c477abacc4886e34a0e90ea0b1f489ceaf5 (patch) | |
tree | 175afcc99ed358d1c062fb8f90b4b8b08cff7932 /spec | |
parent | 91c789ec630757b1de6e0b84aa6b6dac55c6998b (diff) |
Cover Admin::PubSubHubHubController more (#3343)
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/admin/pubsubhubbub_controller_spec.rb | 17 |
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 |