Get select value of dropdown for capybara testing
There's a have_select
matcher if you use Capybara with Rspec:
expect(page).to have_select('my-select', selected: 'Option 2')
find_field('restrictions__rating_movies').find('option[selected]').text
Very simple way to get value of selected option is:
find("#restrictions__rating_movies").value
This will return selected select option value.