cavalle / steak

DISCONTINUED - The delicious combination of RSpec and Capybara for Acceptance BDD
MIT License
763 stars 32 forks source link

undefined method have_content #32

Closed rdavila closed 12 years ago

rdavila commented 13 years ago

If you got this error when running your spec with Rails 2.3:

undefined method `have_content' for #<ActionController::Integration::Session:0x108929d58>

put this at the bottom of your acceptance_helper.rb:

class Spec::Rails::Example::AcceptanceExampleGroup
  raise "Please, try to remove this. In this version of Rails it might be not necessary" unless Rails.version == "2.3.2"
  def method_missing(sym, *args, &block)
    return Spec::Matchers::Be.new(sym, *args) if sym.to_s =~ /^be_/
    return Spec::Matchers::Has.new(sym, *args) if sym.to_s =~ /^have_/
    super
  end
end

Try again and be happy! (thanks to @cavalle by the work around)