1
I have a test Feature failing because the moment it runs some HTML elements (<li data-podcast>
) not yet rendered.
Does anyone know how to fix it?
RSpec.describe 'Podcasts List', type: :feature do
scenario 'A user visits the root page and views a podcasts list' do
visit '/'
within '[data-podcasts]' do
expect(page).to have_selector 'li[data-podcast]', minimum: 3
end
end
end
Are rendered via JS?
– Luiz Carvalho
@Luizcarvalho no, an instance variable is populated with all db files (
@podcasts = Podcast.all
) and then do a each listing all of them (@podcasts.all.each do ..
).– Luan Vicente