1
0
Fork 0
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:
Matt Jankowski 2024-04-30 13:23:27 -04:00
parent a9ee0af17b
commit 3b3e5cd5ac

View file

@ -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