Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8215231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:42:49+00:00 2026-06-07T11:42:49+00:00

I have a simple Cucumber test to see if, on entering invalid credentials, a

  • 0

I have a simple Cucumber test to see if, on entering invalid credentials, a user is sent back to the registration page.

My final step looks like this:

Then /^I should be on the registration page$/ do
  current_path.should == new_user_registration_path
end

However, when someone submits a form and it comes back with errors, they actually end up on “/users”, and not “/users/sign_up”

I’m assuming this is because the user_registration POST method maps to /users. But I don’t wait to test for /users, because that could theoretically be the index of users, which I don’t want to be the error page.

Is there a better way to test form errors in Rails?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T11:42:50+00:00Added an answer on June 7, 2026 at 11:42 am

    You should test that the page that user ends up on contains error text. Treat Cucumber tests as if you were testing manually: you wouldn’t check the url after form submission, but you would look in the page content to understand if the submission was successful or not

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple feature: Feature: User can see the welcome page Scenario: User
I have simple user registration form. In which i am puting city as a
If I have a simple cucumber feature and scenario , like this (example code
I have simple code: <?php error_reporting(E_ALL); ini_set('display_errors', true); ini_set('html_errors', false); $test = array(); $test
I have simple aspx page that has a form and a input field in
I have simple user model: var user = Backbone.Model.extend({ initialize: function(){ this.bind(change:auth, function (){
Have simple Spring Security webapp with password encoding: <security:authentication-manager alias=authenticationManager> <security:authentication-provider user-service-ref=personService> <security:password-encoder hash=md5
I have configured cuke4duke and Cucumber with maven and written feature and step definition
I have simple CCAnimation loading from playlist, and when i test it on emulator
I have simple JSP: <jsp:directive.attribute name=severity type=java.lang.String required=true/> <jsp:directive.attribute name=currentSeverity type=java.lang.String required=true/> <c:if test=${severity

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.