The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Adding Captcha to Rails, Then Fixing the Tests

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Jared Richardson

Posts: 1031
Nickname: jaredr
Registered: Jun, 2005

Jared Richardson is an author, speaker, and consultant who enjoys working with Ruby and Rails.
Adding Captcha to Rails, Then Fixing the Tests Posted: Oct 10, 2006 1:25 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by Jared Richardson.
Original Post: Adding Captcha to Rails, Then Fixing the Tests
Feed Title: Jared's Weblog
Feed URL: http://www.jaredrichardson.net/blog/index.rss
Feed Description: Jared's weblog. The web site was created after the launch of the book "Ship It!" and discusses issues from Continuous Integration to web hosting providers.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by Jared Richardson
Latest Posts From Jared's Weblog

Advertisement

I needed Captcha in a Rails app recently and found a great tutorial on the web. It was easy to add and use once we got RMagic installed. But RMagic was horrible... but that's another blog entry.

I used this page to add the Captcha bits. It's a nice write up. Just follow the directions and you'll be up and running.

However, the Captcha plugin broke a few of our automated tests. So I started to dig in again, but then found another page on the web. I love it when someone else solves a problem for me.

Here's the solution to the Captcha interfering with your tests. I opted for the solution in the comments. I used this line:

validates_captcha :if => Proc.new {|u| ENV['RAILS_ENV'] != 'test'}

Jared

Read: Adding Captcha to Rails, Then Fixing the Tests

Topic: Do You Smell That? Previous Topic   Next Topic Topic: Argument by Assertion

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use