senny / corner_stones

capybara building blocks for acceptance tests.
18 stars 8 forks source link

raise OptionNotFound when filling a select with a text for which there is no option. #38

Closed jone closed 9 years ago

jone commented 9 years ago

When filling a select with a text for which there is no option, I get:

NoMethodError: undefined method `select_option' for nil:NilClass

With this change it will raise a OptionNotFound exception, e.g.:

CornerStones::Form::OptionNotFound: The select "author" does not contain an option "Zaphod Beeblebrox".
Available options: ["Robert C. Martin", "Eric Evans", "Kent Beck"]