How to send a test e-mail from shell
If you want to manually check if e-mail delivery works on a machine by sending an e-mail you...
Imperative vs Declarative Scenarios in User Stories
Bryan talked about the differences between imperative and declarative scenarios. In my opinion, both styles have benefits and should be...
Where to put custom RSpec matchers
When you write a custom RSpec matcher a good place to store them is to create one file per matcher...
Test that a hash contains a partial hash with RSpec
To test whether a hash includes an expected sub-hash: expect(user.attributes).to match(hash_including('name' => 'Bruce Wayne'))
Acceptance testing using Capybara's new RSpec DSL
Back when Steak was first released, Capybara didn’t have any of the nice RSpec helpers it does now. A...
Caching in Rails
The information in this card is only relevant for Rails 2.3-era apps. This note gives a quick introduction into...
Liquid Canvas
Liquid Canvas is a JavaScript library which allows you to draw inside an HTML canvas element with an easy yet...
Upgrade from Ruby 1.8.7 to Ruby 1.9.2 on Ubuntu
Note that you cannot currently use Ruby 1.9.2 with Rails 2 applications that use RSpec, so don't upgrade if...
Prevent an ActiveRecord attribute from being changed after creation
Sometimes you can make your life easier by not allowing a record attribute to be changed after the record was...
Upgrading Cucumber and Capybara to the latest versions available for Rails 2
Specify these gem versions in your Gemfile: gem 'cucumber', '~> 1.3.0' gem 'cucumber-rails', '= 0.3.2' # max version for Rails 2
Onload callback for dynamically loaded images
Sometimes you need to dynamically load an image and do something as soon as its loaded (when for example its...
Customize your Bash prompt
The shell variable PS1 holds your bash prompt. You might want to change it to serve your needs best. Here...
Sanitize user-generated filenames and only send files inside a given directory
If in your application your users pass along params that result in filenames, like invoices/generated?number=123. This could be...
CSS3 Pie: Element not properly redrawn
Pie sometimes does not properly redraw elements upon changes. This often happens when the change comes from somewhere further up...
RSpec matcher to check if an ActiveRecord exists in the database
The attached RSpec matcher exist_in_database checks if a given record still exists in the database and has not...
Mocks and stubs in Test::Unit when you are used to RSpec
We are maintaining some vintage projects with tests written in Test::Unit instead of RSpec. Mocks and stubs are not...
Alternative to url_for's deprecated :overwrite_params option
If you have the following deprecation warning after upgrading to rails >= 2.3.10 DEPRECATION WARNING: The :overwrite_params option is deprecated...
Output the descriptions of RSpec examples while they are running
track down warnings and to see failing specs immediately or to get an overview of the core...
Delete all MySQL records while keeping the database schema
You will occasionally need to clean out your database while keeping the schema intact, e.g. when someone inserted data in...
Synchronize a Selenium-controlled browser with Capybara
When you click a link or a press a button on a Selenium-controlled browser, the call will return control...
plus2/whereuat - GitHub
Adds a slide out panel to your Rails application that directs clients to test stories that have been marked as...
Traversing the DOM tree with jQuery
jQuery offers many different methods to move a selection through the DOM tree. These are the most important: $element.find(selector...
Unexpected behavior when changing both an association and its foreign key attribute in ActiveRecord
When you set both a record's association and that association's foreign key attribute, Rails does not realize you...
Why two Ruby Time objects are not equal, although they appear to be
So you are comparing two Time objects in an RSpec example, and they are not equal, although they look equal...