I'm trying to get the selected value of a dropdown box with next code:
scenario 'USA as default country' do
expect(page).to have_select('report_country_code', selected: 'United States')
end
Html for this field is the next:
<select class="form-control country required" name="report[country_code]" id="report_country_code">
<option value="US">United States</option>
....
....
<option value="ZW">Zimbabwe</option>
</select>
And the error looks like:
expected to find select box "report_country_code" with "United States" selected but there were no matches. Also found "United States .... Zimbabwe", which matched the selector but not all filters.