mirror of
https://github.com/kikobar/mastodon.git
synced 2024-12-24 14:54:13 +00:00
Cover InstancesController more (#3342)
This commit is contained in:
parent
97d7028c31
commit
7b92950f1c
|
@ -8,8 +8,23 @@ RSpec.describe Admin::InstancesController, type: :controller do
|
|||
end
|
||||
|
||||
describe 'GET #index' do
|
||||
it 'returns http success' do
|
||||
get :index
|
||||
around do |example|
|
||||
default_per_page = Account.default_per_page
|
||||
Account.paginates_per 1
|
||||
example.run
|
||||
Account.paginates_per default_per_page
|
||||
end
|
||||
|
||||
it 'renders instances' do
|
||||
Fabricate(:account, domain: 'popular')
|
||||
Fabricate(:account, domain: 'popular')
|
||||
Fabricate(:account, domain: 'less.popular')
|
||||
|
||||
get :index, params: { page: 2 }
|
||||
|
||||
instances = assigns(:instances).to_a
|
||||
expect(instances.size).to eq 1
|
||||
expect(instances[0].domain).to eq 'less.popular'
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue