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

  • SEARCH
  • Home
  • 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 8995077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:34:12+00:00 2026-06-15T23:34:12+00:00

I am using Rails 3.1.0 and the recaptcha gem from here . I was

  • 0

I am using Rails 3.1.0 and the recaptcha gem from here. I was running a cucumber test that checks that users can sign up. Sign up requires users to fill out the captcha. I know that my test does not touch the captcha:

When /^I create a new account with email: "(.*?)" and password: "(.*?)"$/ do |email, pw|
    click_link "Sign up"
    fill_in "Email", :with => email
    fill_in "Password", :with => pw
    fill_in "Password confirmation", :with => pw
    click_button "Sign up"
end

But the test still passes. I check success by verifying that the successful sign up message is present on the page and the recaptcha failure message is not present using this step:

Then /^I should (not )?see "(.*)"$/ do |negate, text|
  if negate
    page.should_not have_content text
  else
    page.should have_content text
  end
end

The controller is almost identical to the first one suggested here.

  class RegistrationsController < Devise::RegistrationsController
    def create
      if verify_recaptcha
        super
      else
        build_resource
        clean_up_passwords(resource)
        flash.now[:alert] = "There was an error with the recaptcha code below. Please re-enter the code."      
        flash.delete :recaptcha_error
        render :new
      end
    end
  end

Is there any reason why recaptcha would not work in the test environment? It seems to work fine in development.

  • 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-15T23:34:13+00:00Added an answer on June 15, 2026 at 11:34 pm

    Recaptcha by default does not verify the captcha in the test and cucumber environments (see verify logic, configuration logic, and default value ). If it weren’t for this, either testing would be very difficult or the captcha wouldn’t be very useful.

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

Sidebar

Related Questions

using rails 3.2.8, I have an application where users can sign in and out,
I'm using Rails 3.1, and trying to setup Recaptcha so that it only shows
I am using the recaptcha gem in Rails 3.1.0. I am following the instructions
Using Rails 3.1.3 with Ruby 1.9.3p0. I've discovered that by default, Rails does not
Using Rails 3.1.3 with Devise 1.5.3. My app has accounts and users. Each account
(Using Rails 3.1.3) I have an app that manages products. I import the products
Using Rails I'm trying to get an error message like The song field can't
Using Rails v2.1, lets say you have an action for a controller that is
Using Rails 2.3.11 , I'm creating a plugin for Redmine that add methods to
I have a problem with Recaptcha gem. I'm using Ubuntu on a virtual machine

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.