Re: [rspec-users] Can not 'assigns' value in View test

2007-09-12 Thread David Chelimsky
On 9/12/07, Shaker <[EMAIL PROTECTED]> wrote: > > Hello, David: > Thank you very much for your help. Now it works! > I would like to recall a message posted several days ago regarding the > "paginate". How to test "paginate" in controller spec? One simple example > may be like this: > hash[:a

Re: [rspec-users] Can not 'assigns' value in View test

2007-09-12 Thread Shaker
Hello, David: Thank you very much for your help. Now it works! I would like to recall a message posted several days ago regarding the "paginate". How to test "paginate" in controller spec? One simple example may be like this: hash[:accounts_pages], hash[:accounts] = paginate :accounts(the t

Re: [rspec-users] Can not 'assigns' value in View test

2007-09-12 Thread David Chelimsky
On 9/12/07, Shaker <[EMAIL PROTECTED]> wrote: > > I also feel puzzled. But that's what my colleagues do, and it works. The > thing is they use > render :partial=>'index', :locals=>{:hash=>hash} > in the controller to pass the hash data to the partial it will render(index > in this case). And late

Re: [rspec-users] Can not 'assigns' value in View test

2007-09-12 Thread Shaker
I also feel puzzled. But that's what my colleagues do, and it works. The thing is they use render :partial=>'index', :locals=>{:hash=>hash} in the controller to pass the hash data to the partial it will render(index in this case). And later they simply use <%= hash %> to get the hash data passed

Re: [rspec-users] Can not 'assigns' value in View test

2007-09-12 Thread David Chelimsky
On 9/12/07, Shaker <[EMAIL PROTECTED]> wrote: > > Unfortunately, I am not supposed to change the code inside the partial. > That's why I posted this message. I am trying to find a way of tackling this > problem. Because I am going to test tens of hundreds of partials, most of > which are using the

Re: [rspec-users] Can not 'assigns' value in View test

2007-09-12 Thread Shaker
Unfortunately, I am not supposed to change the code inside the partial. That's why I posted this message. I am trying to find a way of tackling this problem. Because I am going to test tens of hundreds of partials, most of which are using the symbols rather than instance variable. David Chelimsk

Re: [rspec-users] Can not 'assigns' value in View test

2007-09-12 Thread David Chelimsky
On 9/12/07, Evan David Light <[EMAIL PROTECTED]> wrote: > Granted that I'm new too; however, assigns[:hash] creates a member > variable @hash that is made available to the view. Maybe that's the > problem? Modify your view to use @hash instead. http://rspec.rubyforge.org/documentation/ra

Re: [rspec-users] Can not 'assigns' value in View test

2007-09-12 Thread Evan David Light
Granted that I'm new too; however, assigns[:hash] creates a member variable @hash that is made available to the view. Maybe that's the problem? Modify your view to use @hash instead. On Sep 12, 2007, at 5:20 AM, Shaker wrote: > > Hello everyone: > I am quit new to View test using

[rspec-users] Can not 'assigns' value in View test

2007-09-12 Thread Shaker
Hello everyone: I am quit new to View test using rspec. I want to write spec for a partial, which is rendered by a controller. However, the controller does not pass data to the partial using instance variables, it uses symbol variable instead. I read the example of view spec provided in the webs