Hi, I''m implementing user registration Cucumber scenario. Intentionally leaving CAPTCHA solution field empty I expect to pass my custom THEN I should see "Captcha solution could not be blank" (not exactly that message because of i18n, doesn''t matter) but the scenario fails with the message: "expected the following element''s content to include "Captcha solution could not be blank". Inspecting response content which was flushed below the error message I could not find any validation error message indeed. That is why I doubt validation was done at all. Filling registration form with right the same data and posting it from browser (in same env) results in expected validation errors appear whithin the form. So, my questions are: 1. should Rails behavior in cucumber and development environments be equal if /config/environments/cucumber.rb equals /config/environments/cucumber.rb in case they operate same data? 2. should ActiveRecord validation messages appear when cucumber scenario fills a form with wrong values? thanks in advance! -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Zhoran Tvalve
2010-Mar-01 13:45 UTC
Re: ActiveRecord validation erros with cucumber/webrat
Zhoran Tvalve wrote:> Hi, > I''m implementing user registration Cucumber scenario. Intentionally > leaving CAPTCHA solution field empty I expect to pass my custom > > THEN I should see "Captcha solution could not be blank" > (not exactly that message because of i18n, doesn''t matter) > > but the scenario fails with the message: "expected the following > element''s content to include "Captcha solution could not be blank". > > Inspecting response content which was flushed below the error message I > could not find any validation error message indeed. That is why I doubt > validation was done at all. >just checked out that the error message appears at the page opended by save_and_open_page right before failing THEN statement. Validation was done, that''s good. Any ideas why it absents in the page dump which cucumber produces after THEN failing? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.