[rspec-users] include Helper in context?
dchelimsky at gmail.com
Tue Nov 7 20:10:28 EST 2006
On 11/7/06, Jerry West <jerry.west at ntlworld.com> wrote:
> 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'
Is this a view spec or a helper spec? If it's a view spec, it must be
in a views directory:
Let us know if that solves your problem.
> # 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!
> rspec-users mailing list
> rspec-users at rubyforge.org
More information about the rspec-users