# Using i18n.t in Rspec2 and Rails3

**URL:** <https://www.ruby-forum.com/t/using-i18n-t-in-rspec2-and-rails3/196078>\
**Category:** Rails I18n\
**Created:** [October 6, 2010, 1:13pm UTC](https://www.ruby-forum.com/t/using-i18n-t-in-rspec2-and-rails3/196078 "2010-10-06T13:13:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Skydan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/838e76/32.png) [@Skydan](https://www.ruby-forum.com/u/Skydan)\
**Post date:** [October 6, 2010, 1:13pm UTC](https://www.ruby-forum.com/t/using-i18n-t-in-rspec2-and-rails3/196078/1 "2010-10-06T13:13:14Z")

</div>

Hello! Can anybody help me with using i18n.t method in rspec test  
files?  
I try to test this block:

describe “GET ‘home’” do  
it “should be successful” do  
get ‘home’  
response.should have\_selector(“title”,  
:content =\> @base\_title +  
i18n.t( ‘pages.title.home’ ))  
end  
end

but this error appear:

Failure/Error: :content =\> @base\_title + i18n.t( ‘pages.title.home’ ))  
undefined method `t’ for  
#RSpec::Core::ExampleGroup::Nested\_1::Nested\_4:0xa13716c

---

<div class="post-metadata">

**Author:** ![Skydan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/838e76/32.png) [@Skydan](https://www.ruby-forum.com/u/Skydan)\
**Post date:** [October 8, 2010, 6:16pm UTC](https://www.ruby-forum.com/t/using-i18n-t-in-rspec2-and-rails3/196078/2 "2010-10-08T18:16:51Z")

</div>

Thanks a lot! Thats work fine!

---

<div class="post-metadata">

**Author:** ![Skydan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/838e76/32.png) [@Skydan](https://www.ruby-forum.com/u/Skydan)\
**Post date:** [October 6, 2010, 1:20pm UTC](https://www.ruby-forum.com/t/using-i18n-t-in-rspec2-and-rails3/196078/3 "2010-10-06T13:20:50Z")

</div>

Try this:

i18n.t(…) =\> NO  
I18n.t(…) =\> Yes

The i is uppercase =\> I18n
