senny / corner_stones

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

Different cases for UnknownFieldErrors #15

Open senny opened 12 years ago

senny commented 12 years ago

Currently the UnknownFieldError is raised under different circumstances. The name suggests, that the field was found but corner_stones does not know how to handle it:

don't know how to fill the field veranstaltung_sektion (CornerStones::Form::UnknownFieldError)

This could happen with custom inputs, or html5 fields we haven't implemented at the moment.

On the other hand this error also occurs, when there is no such field on the page, or when there is a label with the right name but the for attribute does not point to a valid field.

I think we should either change the error-message to explain the cause better or raise a different error when the field is not on the page.