diff options
author | Matt Jankowski <mjankowski@thoughtbot.com> | 2017-05-31 14:39:35 -0400 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-05-31 20:39:35 +0200 |
commit | de4681b2be0b0efa1dede092445a53d4a593c140 (patch) | |
tree | 2b481f7ceef23f467dafaa4eba7e35db0559a42e /spec/controllers/admin/subscriptions_controller_spec.rb | |
parent | a132332b861f997540f30be1b90ade4648834b5b (diff) |
Move admin/pubsubhubbub controller to admin/subscriptions (#3442)
Diffstat (limited to 'spec/controllers/admin/subscriptions_controller_spec.rb')
-rw-r--r-- | spec/controllers/admin/subscriptions_controller_spec.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/controllers/admin/subscriptions_controller_spec.rb b/spec/controllers/admin/subscriptions_controller_spec.rb new file mode 100644 index 000000000..eb6f12b16 --- /dev/null +++ b/spec/controllers/admin/subscriptions_controller_spec.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true +require 'rails_helper' + +RSpec.describe Admin::SubscriptionsController, 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 '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 +end |