[rspec-users] Testing User Agent

Suprie Leonhart suprie.leonheart at gmail.com
Thu Feb 26 01:03:20 EST 2009


On Thu, Feb 26, 2009 at 12:08 PM, Nick Hoffman <nick at deadorange.com> wrote:

> On 25/02/2009, at 9:49 PM, Suprie Leonhart wrote:
>
>> On Thu, Feb 26, 2009 at 4:39 AM, Nick Hoffman <nick at deadorange.com>
>> wrote:
>>
>> Hi Suprie. AFAIK, RSpec populates the "request" object in your specs after
>> a controller action is called. Since your "should know if it's from
>> blackberry" example doesn't call a controller action, the "request" object
>> is nil.
>> -Nick
>>
>> so i should put the test on controller spec then ?
>>
>> --
>> --
>> Best Regards
>> Suprie
>>
>
> Ultimately, you should be speccing your application's behaviour rather than
> specific methods. If a controller action calls #mobile_content? , then write
> specs for that action, and make sure to cover the case(s) when
> #mobile_content? is called.
>

thanks a lot for the advice.



-- 
--
Best Regards
Suprie
http://suprie.in.ruangkopi.com

"Mendapat upah karena menyenangkan orang lain yang tidak punya persangkutan
dengan kata hati sendiri, kan itu dalam seni namanya pelacuran?"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090226/57c29405/attachment.html>


More information about the rspec-users mailing list