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...
If you’re testing the behavior of deprecated code in your Ruby project, the warning messages littered throughout your spec...
Git allows you to do a binary search across commits to hunt down the commit that introduced a bug.
These steps are now part of Spreewald. The step definitions below allow you to test the filename suggested by the...
The step definitions below allow you to write this in both Webrat and Capybara: When I follow "Download as PDF...
Our collection of the most useful Cucumber steps, Spreewald, now supports exact matching of form fields and lets you use...
In order to redirect all requests from redirecting-host.com to desired-host.com while keeping path and query params unchanged, change your Apache...
In RSpec 2 shared_examples_for can have parameters. You can simply hand over arguments from it_behaves...
When you need to see the content of a page (i.e. not all the HTML but the relevant text body...
You can usually just use the eq matched to compare two numbers: expect(deal.total).to eq(120)
You can use these step definitions: Then /^I should not see an error$/ do (200 .. 399).should include(page.status_code...
When you eagerly load an association list using the .include option, and at the same time have a .where on...
RSpec 1, RSpec 2 To test whether two arrays have the same elements regardless of order, RSpec 1 and 2...
Deadlocks only occur if two transactions in separate threads compete for the same rows in the database. They usually (but...
If your controller spec never reaches your controller code: Make sure you are signed in. Make sure you are actually...
When a has_many association basically serves to store a list of associated strings (tags, categories, ...), it can be convenient...
When you just went through a long debug-fest and infested your code with dozens of debug messages, it can...
Don't insert table rows in a Rails database migration. This will break tests that expect that database to be...
Occasionally some complex query must be processed on the database because building thousands of Ruby objects is impracticable.
In order to go back one page in your Cucumber tests, you can use the following step definition for Capybara...
Plugins (and gems) are typically tested using a complete sample rails application that lives in the spec folder of the...