[rspec-devel] [ rspec-Bugs-6713 ] helper methods not rendered in view tests?

noreply at rubyforge.org noreply at rubyforge.org
Sun Nov 19 10:26:49 EST 2006


Bugs item #6713, was opened at 2006-11-16 17:34
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=6713&group_id=797

Category: None
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Micah Martin (slagyr)
Assigned to: Nobody (None)
Summary: helper methods not rendered in view tests?

Initial Comment:
Apprently helpers are not rendered in view tests...

template _xyz:
<div>
	<% form_remote_tag :update => "some_div", :url => {:action => :something } %>
		<textarea style="width: 100%" rows="2">Enter text here.</textarea>
	<% end_form_tag %>
</div>


failing spec:
  specify "Form is rendered" do
    
    render "/controller/_xyz"
    response.should_have_tag 'form', :parent => { :tag => "div" }
  end

----------------------------------------------------------------------

Comment By: David Chelimsky (dchelimsky)
Date: 2006-11-19 15:26

Message:
moving this to Bugs

----------------------------------------------------------------------

Comment By: Micah Martin (slagyr)
Date: 2006-11-17 17:31

Message:
The above example has a mistake... the form_remote_tag tag is missing an =.

Still, custom helper methods are not being resolved in view specs.

For example if I have in app/helpers/controller_helper.rb:

def my_helper
 return "blah"
end

And in my template I use:

<%= my_helper  %>

The view tests will throw an error:

undefined method `my_helper' for #<#<Class:0x2691bc0>:0x2691a80>

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=6713&group_id=797


More information about the rspec-devel mailing list