[rspec-users] testing instance variables that are set inside views

Jeremy Stephens jeremy.f.stephens at vanderbilt.edu
Fri Jun 29 17:17:15 EDT 2007


Hi all,

In my view specs (for Rails), how can I get at instance variables that 
are set within my view?  For example, if my view looks like this:

<% @header = "My Header" -%>
<div>some content</div>

How can I get to @header from within my view spec?  I've tried @header 
and assigns[:header] to no avail.

TIA,
Jeremy

-- 
Jeremy Stephens   Computer Systems Analyst I    School of Medicine
                  Department of Biostatistics   Vanderbilt University



More information about the rspec-users mailing list