20 cards
View
Posted about 2 years ago. Visible to the public.

rspec-rails 1.3 compatibility fork for Rails LTS 2.3

An expectation like this will fail with Rails LTS 2.3:

Copy
should render_template(:edit)

The error will look like this:

Copy
expecting <:edit> but rendering with <"">

This is an issue with rspec-rails 1.x monkey-patching into ActionController during controller specs.

Fix

To fix this, use our compatibility fork of rspec-rails 1.3.

With Bundler

If you are using Rails 2.3 LTS with Bundler you can use the fork by updating your Gemfile:

Copy
gem 'rspec-rails', :git => 'https://github.com/makandra/rspec-rails.git', :branch => '1-3-lts'

Now run bundle update rspec-rails.

Without Bundler

If you are using Rails 2.3 LTS without Bundler, require the attached monkey patch before your specs to fix this.

Owner of this card:

Avatar
Henning Koch
Last edit:
7 months ago
by Henning Koch
Attachments:
rspec-rails_record_render.rb
This website uses cookies to improve usability and analyze traffic.
Accept or learn more