# Test/partials problem

**URL:** <https://www.ruby-forum.com/t/test-partials-problem/116405>\
**Category:** Rails\
**Created:** [October 5, 2007, 7:23am UTC](https://www.ruby-forum.com/t/test-partials-problem/116405 "2007-10-05T07:23:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike](https://www.ruby-forum.com/u/mike)\
**Post date:** [October 5, 2007, 7:23am UTC](https://www.ruby-forum.com/t/test-partials-problem/116405/1 "2007-10-05T07:23:00Z")

</div>

hi,

i have a partial that works fine in my application but when i run  
functional tests they fail when my partial references any locals that  
I have passed in. if i change references to ‘locals’ in the partial to  
have a @ prepended the tests run fine but it doesn’t work in the app.  
any suggestions?

thanks,  
mike

---

<div class="post-metadata">

**Author:** ![mike](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike](https://www.ruby-forum.com/u/mike)\
**Post date:** [October 5, 2007, 6:47pm UTC](https://www.ruby-forum.com/t/test-partials-problem/116405/2 "2007-10-05T18:47:19Z")

</div>

On 10/5/07, mike [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> hi,
> 
> i have a partial that works fine in my application but when i run  
> functional tests they fail when my partial references any locals that  
> I have passed in. if i change references to ‘locals’ in the partial to  
> have a @ prepended the tests run fine but it doesn’t work in the app.  
> any suggestions?

Not enough info. Post your code and your tests.

---

<div class="post-metadata">

**Author:** ![mike](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike](https://www.ruby-forum.com/u/mike)\
**Post date:** [October 5, 2007, 8:38pm UTC](https://www.ruby-forum.com/t/test-partials-problem/116405/3 "2007-10-05T20:38:35Z")

</div>

Maybe use the debugger to analyze what is happening.

Bob S. wrote:

> On 10/5/07, mike [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > hi,
> > 
> > i have a partial that works fine in my application but when i run  
> > functional tests they fail when my partial references any locals that  
> > I have passed in. if i change references to ‘locals’ in the partial to  
> > have a @ prepended the tests run fine but it doesn’t work in the app.  
> > any suggestions?
> 
> Not enough info. Post your code and your tests.

---

<div class="post-metadata">

**Author:** ![mike](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike](https://www.ruby-forum.com/u/mike)\
**Post date:** [October 5, 2007, 11:57pm UTC](https://www.ruby-forum.com/t/test-partials-problem/116405/4 "2007-10-05T23:57:28Z")

</div>

Cool thanks. I haven’t had a chance to do anything about it but it  
occurred to me what the problem was. The partial relies on a global  
var that I forgot to make sure was set in one of my controllers.  
Whenever a test like this fails it’s always such a great reassurance  
of the value of testing. Thanks again for your input. -Mike
