ActiveRecord validation erros with cucumber/webrat

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!

Zhoran T. 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?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs