Webrat error on form submit
I was getting a bizarre error from Webrat:
And I press "Next" # features/step_definitions/webrat_steps.rb:10 You have a nil object when you didn't expect it! The error occurred while evaluating nil.submit (NoMethodError) (eval):2:in `click_button' ./features/step_definitions/webrat_steps.rb:12:in `/^I press "(.*)"$/' features/choosing_varieties.feature:39:in `And I press "Next"'
It turns out, my HTML tags were not nested properly… I had a <table><form></table></form> kind of situation. If you’re getting an error like this, try validating your HTML.