logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

subscriptions_controller_spec.rb (771B)


  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. RSpec.describe Admin::SubscriptionsController, type: :controller do
  4. render_views
  5. describe 'GET #index' do
  6. around do |example|
  7. default_per_page = Subscription.default_per_page
  8. Subscription.paginates_per 1
  9. example.run
  10. Subscription.paginates_per default_per_page
  11. end
  12. before do
  13. sign_in Fabricate(:user, admin: true), scope: :user
  14. end
  15. it 'renders subscriptions' do
  16. Fabricate(:subscription)
  17. specified = Fabricate(:subscription)
  18. get :index
  19. subscriptions = assigns(:subscriptions)
  20. expect(subscriptions.count).to eq 1
  21. expect(subscriptions[0]).to eq specified
  22. expect(response).to have_http_status(:success)
  23. end
  24. end
  25. end