Testing jquery-ui autocomplete with cucumber/capybara

Posted: November 16th, 2010 | Author: | Filed under: jquery, web | No Comments »

I had been running some features that were working on older versions of cucumebr/capybara with the selenium driver which had recently broke. I was able to find a site that has a nice explanation of how to do it. I was already doing most of this as I had found it before, but adding this step was very helpful.


Rails, Rack Middleware, Cucumber and Selenium gotcha

Posted: September 15th, 2010 | Author: | Filed under: jquery, ruby, web | Tags: , , , , | No Comments »

I’m testing a web application that includes an AJAX file uploader which works fine when I run it in the browser but fails when running a Cucumber feature with Selenium. To process the upload in Rails I’m using a Rack middleware that will put the file into the params for me.

Looking at the parameter output I saw that the file was being sent to the server, but not processed. In my config.ru file I had use Rack::RawUpload, :paths => ['/searches/upload']to setup the middleware, but running “rake middleware” didn’t show it as being active. It seems there are two ways to activate the middleware and I was using the one that requires the server to be started with the config.ru file. The Cucumber/Capybara/Selenium uses Webrick which doesn’t start that way. So I moved my middleware initialization into initializers/middleware.rb and now things are working nicely.
Qtlhighliter::Application.config.middleware.use(Rack::RawUpload, :paths => ['/searches/upload'])


Visual password strength checker for jQuery

Posted: January 25th, 2010 | Author: | Filed under: jquery | Tags: | No Comments »

A simple JS file that uses regex to determine the strength of a password.

built on the work of
http://www.zorched.net/2009/05/08/password-strength-validation-with-regular-expressions/
and
http://www.techpint.com/programming/regular-expression-check-password-strength


jQuery function to set elements to the same height

Posted: October 20th, 2009 | Author: | Filed under: jquery | Tags: | No Comments »

I was trying to setup some boxes to be the same height using css, and it seemed that eventually one of the boxes had enough content to make the box go into scroll mode. So instead of hard coding the box height, I decided to write a jQuery function to find the tallest one, and set all the boxes to that height.

So once you have that, you can then use it like this.