Bryan Ray wrote:
> I believe the problem is that you're not telling the Language model
> what to stub/mock when it calls the find method inside of
> set_site_language.
>
> I'm not entirely sure, but I would imagine that the TestUnit test is
> passing, because it's using the full Rails stack to run
I believe the problem is that you're not telling the Language model
what to stub/mock when it calls the find method inside of
set_site_language.
I'm not entirely sure, but I would imagine that the TestUnit test is
passing, because it's using the full Rails stack to run the test.
Try doing
David Chelimsky wrote:
> On Jul 3, 2008, at 2:24 AM, Damian Terentiev wrote:
>
>> def set_site_language
>>@site_language = cookie['lang'] ?
>> Language.find_by_code(cookie['lang']) :
>> Language.find(:first)
>
> Shouldn't this be cookies, not cookie? Doesn't explain why the test
>
On Jul 3, 2008, at 2:24 AM, Damian Terentiev wrote:
Good day!
I have a Rails app with a controller that sets an instance variable
in a
before_filter, like this:
class PostsController < ApplicationController
before_filter :set_site_language
def set_site_language
@site_language = cooki
Good day!
I have a Rails app with a controller that sets an instance variable in a
before_filter, like this:
class PostsController < ApplicationController
before_filter :set_site_language
def set_site_language
@site_language = cookie['lang'] ?
Language.find_by_code(cookie['lang'])