Forum: Rails I18n Using i18n.t in Rspec2 and Rails3

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Skydan (Guest)
on 2010-10-06 13:13
(Received via mailing list)
Hello! Can anybody help me with using i18n.t method in rspec test
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' ))

but this error appear:

Failure/Error: :content => @base_title + i18n.t( 'pages.title.home' ))
    undefined method `t' for
Adce10d7f1dbabcdab8f525a59cec32f?d=identicon&s=25 Andrés Gutiérrez (andresgutgon)
on 2010-10-06 13:20
(Received via mailing list)
Try this:

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

The i is uppercase => I18n
Skydan (Guest)
on 2010-10-08 18:16
(Received via mailing list)
Thanks a lot! Thats work fine!
This topic is locked and can not be replied to.