ruby on rails - Testing invalid form submission with Cucumber -


I have a simple cocaine test, to see that, upon entering the illegal identification, the user will return to the registration page Is sent. / P>

My last step looks like this:

  then / ^ I should be at the registration page $ / current_path.should == new_user_registration_path end   

However, when one submits a form and it comes back with errors, they actually end up with "/ user", and not "/ users / sign_up"

I am assuming this because the users / users of the registration method methods / users but the symbol for testing for me / users Should protect it does not, because it was an indicator of the presence of users, that I do not want an error page.

Is there a better way to test form errors in the rail?

You should check that the page on which the user ends is in the error text of cucumber examinations Test as if you were manually testing: url will not be checked after form submission, but you will see in page content to understand whether submissions are successful

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -