mirror of
https://github.com/mastodon/mastodon.git
synced 2024-08-20 21:08:15 -07:00
Check response body instead of assigns in admin instances controller spec
This commit is contained in:
parent
a9ee0af17b
commit
3b3e5cd5ac
1 changed files with 6 additions and 3 deletions
|
@ -28,12 +28,15 @@ RSpec.describe Admin::InstancesController do
|
||||||
it 'renders instances' do
|
it 'renders instances' do
|
||||||
get :index, params: { page: 2 }
|
get :index, params: { page: 2 }
|
||||||
|
|
||||||
instances = assigns(:instances).to_a
|
expect(instance_directory_links.size).to eq(1)
|
||||||
expect(instances.size).to eq 1
|
expect(instance_directory_links.first.text.strip).to match('less.popular')
|
||||||
expect(instances[0].domain).to eq 'less.popular'
|
|
||||||
|
|
||||||
expect(response).to have_http_status(200)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def instance_directory_links
|
||||||
|
Nokogiri::Slop(response.body).css('div.directory__tag a')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'GET #show' do
|
describe 'GET #show' do
|
||||||
|
|
Loading…
Reference in a new issue