Updated: Check whether an element is visible or hidden with Javascript
Determining whether an element is truly visible in the browser can differ across JavaScript libraries; jQuery and Prototype use different visibility rules.
Loading half a billion rows into MySQL
Bulk loading huge datasets into InnoDB can take hours or days and strain disk, logs, and indexes; careful tuning keeps imports from dragging on indefinitely.
Letter Opener
Preview email in the browser instead of sending it, making message review and debugging easier during development.
What's My DNS? Global DNS Propagation Checker
Check a hostname’s current IP address and DNS records against name servers worldwide to verify DNS propagation after zone changes.
ActiveSupport::StringInquirer
Wrapping a string in this class gives you a prettier way to test for equality.
plus2/whereuat - GitHub
Adds a slide out panel to your Rails application that directs clients to test stories that have been marked as 'delivered' in Pivotal Tracker.
Run a rake task in all environments
Use like this:
power-rake db:migrate VERSION=20100913132321
By default the environments development, test, cucumber and performance are considered. The script will not run rake on a production or staging environment.
This script is part of our geordi gem on github.
Railscheck project home page
This project is (or will be) a best effort semi-static verifier for your Ruby on Rails projects. Delivered as a Ruby gem it provides a shell command task "railscheck" that you can run against your Rails projects to test for a number of typical bugs, potential problems and inconsistencies.
Integrity | The easy and fun automated continuous integration server
Integrity is the angel watching over your shoulder while you code. As soon as you push your commits, it builds, runs your tests, and makes sure everything works fine.
mdub's sham_rack at master - GitHub
Or, you can test your Rack application (or Sinatra, or Rails, or Merb) using arbitrary HTTP client libraries, to check interoperability.
citrusbyte's contest at master - GitHub
Write declarative tests using nested contexts without performance penalties. Contest is less than 100 lines of code and gets the job done.
thumblemonks's riot at master - GitHub
Riot differs primarily in that it does not rerun setup for each test in a context.
Localized external services - GIANT ROBOTS SMASHING INTO OTHER GIANT ROBOTS
ShamRack mounts a Rack app locally, just for your tests. It goes one further: it “mounts” it using Net::HTTP such that requests to the Rack app never hit any network.
mynyml's holygrail at master - GitHub
The Holy Grail of testing for front-end development; execute browser-less, console-based, javascript + DOM code right from within your Rails test suite.
Properly require your "spec_helper"
Different require paths for spec_helper can execute the same file multiple times in Ruby 1.8; using one consistent require 'spec_helper' avoids duplicate loading.
How to make RubyMine aware of Cucumber steps defined in gems
RubyMine can flag Cucumber steps from gems as undefined because external step definitions are not linked by default. Adding the gem under Cucumber settings restores navigation and resolution.
Use Shoulda's validate_uniqueness_of matcher correctly
validate_uniqueness_of in Shoulda needs an existing record; without it, RSpec can raise “Could not find first Keyword” during uniqueness checks.
How to doubleclick in Selenium
Capybara tasks can be double-clicked by using Selenium-backed double_click on the matched element; plain Capybara alone does not handle double-clicks.
Rails: Have different session secrets for all environments
Using the same Rails session secret in staging and production can let a cookie from one environment authenticate in another. Separate secrets per environment reduce session hijacking risk.
Exclude your staging site from Google with robots.txt and not shoot yourself in the foot
Staging sites can be kept out of Google with robots.txt while avoiding a forgotten block on launch by serving a separate exclude file on staging only.
Override e-mail recipients in ActionMailer
Our gem Mail Magnet allows you to override e-mail recipients in ActionMailer so all mails go to a given address.
This is useful for staging environments where you want to test production-like mail delivery without sending e-mails to real users.