ruby on rails - In rspec/capybara, I need a version of "within" that checks all descendants, not just children -
i have snippet of code designed count number of list items in dropdown menu:
within ('#campaign_duration_in_days_input') page.all('li').count.should eql(4) end that returns 0, although there 4 list items descendants of div (not direct children). how can count of descendants?
i can't see wrong code. within works indirect descendants direct children. throw error if argument #campaign_duration_in_days_input looks element exists.
so looks not finding li elements. if plain old html select dropdown should looking option elements? if not try save_and_open_page before within inspect dom see happening.
Comments
Post a Comment