1
0
mirror of https://github.com/mastodon/mastodon synced 2024-12-22 18:48:14 +09:00
mastodon/spec/controllers/admin/pubsubhubbub_controller_spec.rb

33 lines
770 B
Ruby
Raw Normal View History

# frozen_string_literal: true
require 'rails_helper'
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
2016-11-29 23:49:39 +09:00
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