# Globalize plugin makes my tests fail

**URL:** <https://www.ruby-forum.com/t/globalize-plugin-makes-my-tests-fail/127432>\
**Category:** Rails\
**Created:** [January 29, 2008, 5:06am UTC](https://www.ruby-forum.com/t/globalize-plugin-makes-my-tests-fail/127432 "2008-01-29T05:06:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![obenhauser](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/d78d45/32.png) [@obenhauser](https://www.ruby-forum.com/u/obenhauser)\
**Post date:** [January 29, 2008, 5:06am UTC](https://www.ruby-forum.com/t/globalize-plugin-makes-my-tests-fail/127432/1 "2008-01-29T05:06:26Z")

</div>

I installed the globalize plugin to add translation to my app.  
However, after following the setup, all my functional tests for all  
controllers are failing, including the one’s that gor created by  
generate scaffold.

Here’s an example:

def test\_should\_show\_category  
get :show, :id =\> 1  
assert\_response :success  
end

Exception: You have a nil object when you didn’t expect it!  
The error occured while evaluating nil.code

I think the errors occur because globalize redirects to add the  
language code to the url in;

redirect\_to params.merge( ‘locale’ =\> Locale.base\_language.code )

I’m a newbie to ROR and can’t figure out how to test around this.
