Sometimes the Rails helper #distance_of_time_in_words is using too much magic. When you need a time difference...
Do you wonder which databases are actually taking up how much space but only have one huge ibdata1 in your...
Detecting if a Javascript is running under Selenium WebDriver is super-painful. It's much easier to detect the current...
Vim allows recording a batch of commands as a macro. This is handy if you need to do the same...
Hint: There's another card with this helper for Cucumber features. Sometimes you feel like you need to stub some...
tl;dr: Always have your attachment path start with :rails_root/storage/#{Rails.env}#{ENV['RAILS_TEST_NUMBER']}/. The directory where you...
If you get the error "413 Request Entity Too Large" from Nginx client_max_body_size is too low (default...
Don't simply test for the presence of the magic Paperclip attribute, it will return a paperclip Attachment object and...
When your Cucumber feature needs to browse the page HTML, and you are not sure how to express your query...
When you need to create a locale for a language variant (like Austrian for German), you probably don't want...
Code example for implementing Cross-Origin Resource Sharing (CORS) in Rails.
When you need to zip up files in Ruby, use zipruby. sudo gem install zipruby You can add existing files...
If you're writing a spec for an application using Resque, you may need to work off queues manually without...
Note: While the solution in this card should still work, we prefer another solution now: Hide your Selenium browser window...
This finally works: User.any_instance.should_receive(…) as does User.any_instance.stub(…) Note: You won't have RSpec 2.6 if you're still working...
In order to use different encodings than ASCII for HTTP headers use the following syntax: Header-Key: Header-Value; Parameter...
Sometimes you need a file of some size (possibly for testing purposes). On Linux, you can use dd to create...
Note: Consider using MATE instead of Gnome 3 on newer system Awesome is a very good tiling window manager that...
With gem dependency it is possible to check the dependencies for your gem before you install it.
When you generate a URL in a mailer view, ActionMailer will raise an error unless you previously configured it which...
I've recently encountered a weird problem with specs making lots of SOLR queries using the acts_as_solr plugin...
If you need to parse a large XML file (> 20 MB or so), you should parse it in chunks, otherwise...
These steps are now part of Spreewald. Since Capybara 0.4.1 a within scope will only look at the first element...
The step definition below allows you to write: Then I should see a link labeled "Foo" But I should not...