There’s a have_select
matcher if you use Capybara with Rspec:
expect(page).to have_select(
'my-select', # locator
selected: 'Option 2' # option
)
Parameters:
Locator (String) (defaults to: nil) — The label, name or id of a select box
Options (Hash) using :selected
(String, Array) — Options which should be selected