[rspec-users] include Helper in context?

Jerry West jerry.west at ntlworld.com
Tue Nov 7 16:56:23 EST 2006


can you get your Helpers to work in rspec 0.7 ?  I'm including them in 
the context but the render fails to see it.

If you have it working, I'll go back and bang my head against it some 
more, otherwise I'll file a bug!

Many thanks,

context "account/login (view)" do 
  include StandardHelpers
  specify 'displays title "Login"' do
    self.methods.should_include 'title'
    render 'account/login'
    response.should_have_tag 'h1', :content => 'Login'
# fails with:
ActionView::TemplateError in 'account/login (view) displays title "Login"'
undefined method `title' for #<#<Class:0xb73154ac>:0xb7314f70>
On line #1 of app/views/account/login.rhtml

    1: <% title 'Login' %>		(a yield block in the layout)

Note that methods.should_include 'title' passes!

More information about the rspec-users mailing list