Validations that need to access an associated object may lead to some trouble. Let's exemplify that using this example...
ActiveRecord gives you the :include option to load records and their associations in a fixed number of queries. This is...
ActiveRecord models know how to cast a given string to the type of a given attribute (or column).
Reading a URL via GET: curl http://example.com/ Defining any HTTP method (like POST or PUT): curl http://example.com/users/1...
The Basic Authentication header encodes username and password. Effectively, it's just Base64 plus a "Basic" prefix.
It is common in Rails 3.0 applications that you want to provide default views for a group of controllers. Let...
If you want to manually check if e-mail delivery works on a machine by sending an e-mail you...
Bryan talked about the differences between imperative and declarative scenarios. In my opinion, both styles have benefits and should be...
When you write a custom RSpec matcher a good place to store them is to create one file per matcher...
To test whether a hash includes an expected sub-hash: expect(user.attributes).to match(hash_including('name' => 'Bruce Wayne'))
Back when Steak was first released, Capybara didn’t have any of the nice RSpec helpers it does now. A...
The information in this card is only relevant for Rails 2.3-era apps. This note gives a quick introduction into...
Liquid Canvas is a JavaScript library which allows you to draw inside an HTML canvas element with an easy yet...
Note that you cannot currently use Ruby 1.9.2 with Rails 2 applications that use RSpec, so don't upgrade if...
Sometimes you can make your life easier by not allowing a record attribute to be changed after the record was...
Specify these gem versions in your Gemfile: gem 'cucumber', '~> 1.3.0' gem 'cucumber-rails', '= 0.3.2' # max version for Rails 2
Sometimes you need to dynamically load an image and do something as soon as its loaded (when for example its...
The shell variable PS1 holds your bash prompt. You might want to change it to serve your needs best. Here...
If in your application your users pass along params that result in filenames, like invoices/generated?number=123. This could be...
Pie sometimes does not properly redraw elements upon changes. This often happens when the change comes from somewhere further up...
The attached RSpec matcher exist_in_database checks if a given record still exists in the database and has not...
We are maintaining some vintage projects with tests written in Test::Unit instead of RSpec. Mocks and stubs are not...
If you have the following deprecation warning after upgrading to rails >= 2.3.10 DEPRECATION WARNING: The :overwrite_params option is deprecated...
track down warnings and to see failing specs immediately or to get an overview of the core...