You will occasionally need to clean out your database while keeping the schema intact, e.g. when someone inserted data in...
When you click a link or a press a button on a Selenium-controlled browser, the call will return control...
Adds a slide out panel to your Rails application that directs clients to test stories that have been marked as...
jQuery offers many different methods to move a selection through the DOM tree. These are the most important: $element.find(selector...
When you set both a record's association and that association's foreign key attribute, Rails does not realize you...
So you are comparing two Time objects in an RSpec example, and they are not equal, although they look equal...
In order to cover some edge cases you rarely care about, Range#include? will become very slow in Ruby 1.9...
If you have content inside a page that is hidden by CSS, the following will work with Selenium, but not...
If you want to get a deep understanding of how closures, blocks, procs & lambdas in Ruby work, check out the...
Although you can access many symbols using the AltGr key you may be missing some, like the en-dash (–) or...
A while ago we were working on an application that had an entire version specially created for mobiles, such as...
Note: For PostgreSQL you should use advisory locks. For MySQL we still recommend the solution in this card.
To test whether two arrays have the same elements regardless of order, you can use the =~ matcher in RSpec < 2.11...
This note describes a Cucumber step definition that lets you say: Then "Mow lawn" should be an option for "Activity...
If you run specs or your application and get an error like: ActionController::MissingFile in 'ProductsController#show, should render PDF...
The idea is this: you take a job that you'd rather not do manually, and describe it to babushka...
A check if two date or time ranges A and B overlap needs to cover a lot of cases:
Sometimes it is useful to define a named scope by implementing a static method with the scope's name on...
Given group size If you would like to split a Ruby array into pairs of two, you can use the...
Then /^I should get a response with status (\d+)$/ do |status| response.status.should include(status) end Capybara Then /^I should...
This card describes a Cucumber step that lets you say: When I perform basic authentication as "username/password" and I visit...
When defining a trait using the Modularity gem, you must take extra steps to define constants to avoid caveats (like...
This is for those who already own an SSL certificate (e.g. using it in the Apache HTTP Server) and need...
Update: This trick probably isn't very useful anymore in Ruby 2.x. The Ruby GC has improved a lot...