Single step and slow motion for Cucumber scenarios can come in handy, especially in @javascript scenarios. # features/support/examiners.rb AfterStep('@slow_motion...
In order to open a MySQL shell without the need to enter user and password, you can say the following...
The technique described in this card has an important caveat: The result of GROUP_CONCAT is truncated to the maximum...
Sometimes you want to use a vanilla Ruby method like a block. You can use Object#method to obtain a...
Consider you have a website vhost listening to www.example.com, redirecting all incoming requests that do not talk about the configured...
Observed on Rails 2.3 and machinist 1.0.6 Like the title says, when you define the method empty? like in the...
When you don't know which options are available, but need to have an option selected, use this step.
Remember how Rails 2 came with an awesome feature that broke all code using Time.now or Time.parse? This behavior is...
Simple: Tell the application controller how to handle exceptions, here a RecordNotFound error. Do this with the following line: # application_controller.rb...
When writing a piece of reusable code, you sometimes need to have separate code for Rails 2 and Rails 3...
While it might seem trivial to implement an invoice that sums up items and shows net, gross and vat totals...
I recently browsed through the ActiveSupport code and found some nice stuff I did not know about: ActiveSupport::Callbacks
When the Ruby parser module of Ruby-GetText comes across a file in one of its search directories (e.g. lib/scripts...
Open up your "Base File.sublime-settings" (Preferences Menu → File Settings – User) in Sublime Text 2. Add entries for font_face...
Hint: There's another card with this helper for Cucumber features. Sometimes you feel like you need to stub some...
When you need to create a locale for a language variant (like Austrian for German), you probably don't want...
Passenger gives you the possibility to define in which environment your app should be started. This has to be added...
When you have a program running in a hidden X screen (like with Xvfb for Selenium tests) you may want...
Note: If you are currently working with Ruby 1.8.7 or 1.9.3, we recommend to upgrade to Ruby 2.1 first. From...
In Rails 2, you could use link_to_remote...
...:update => 'id' to automatically replace the content of $('#id').
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...
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...
When you generate a URL in a mailer view, ActionMailer will raise an error unless you previously configured it which...