This project is archived and is in readonly mode.

#3119 ✓resolved
George Ogata

[patch] IntegrationTest not propagating method_missing when appropriate

Reported by George Ogata | August 31st, 2009 @ 05:39 AM

AC::IntegrationTest:

  • derives from AS::TestCase.
  • has a method_missing which delegates methods to its Session object.
  • does not propagate the method_missing to its superclass if the Session object does not respond_to? the method.

This kills RSpec's IntegrationExampleGroup, as RSpec implements matchers like be_* via method_missing by mixing its Matchers module into AS::TestCase. I consider this to be a bug in IntegrationTest--it should propagate method_missing to its superclass if the session object can't handle it. Patch attached.

To reproduce the issue:

gem install rails rspec-rails
rails testapp
cd testapp
script/generate rspec
mkdir spec/integration
$EDITOR spec/integration/integration_spec.rb

Add the following:

require 'spec/spec_helper'

describe "Integration example groups", :type => :integration do
  it "should have RSpec matchers available" do
    true.should be_true
  end
end

Then:

rake db:migrate
rake spec:integration

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Pages