score:2

Accepted answer

have_checked_field takes the id, name, or associated label text of a checkbox element - it doesn't take a css selector. if you don't have an id, name, or label text to use and only have one item with the task-completed class then you should be able to rewrite your expectation as

expect(page).to have_css('.task-completed:checked')

Related Query

More Query from same tag