Hi All I''m attempting to get all of my tests clear after installing the Salted Hash Login generator. Now I''ve protected the entire application so login is required from all points. However I get a fail 302 on all other protected controllers as I haven''t explicitly logged in and got the session. I thought adding the following to the beginning of my methods in the other controllers would be ok: post :login, "user" => { "login" => "username", "password" => "testpass" } assert_session_has "user" However, it assumes the current controller being tested. How do I go through the other login/user controller before running through these tests requiring user session data? Is there a way of simply setting the session data to bypass that test? Would much appreciate your help as I feeel I''m making strides on this now but just need to get over this little hurdle. All the best Doug -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060321/f588262b/attachment.html
get and post allow a third parameter: a hash that is the session. So, pass in what SHLG expects to see in the session for an auth''d user, and your tests will pass. -- -- Tom Mornini On Mar 21, 2006, at 4:36 AM, Doug Bromley wrote:> Hi All > > I''m attempting to get all of my tests clear after installing the > Salted Hash Login generator. Now I''ve protected the entire > application so login is required from all points. However I get a > fail 302 on all other protected controllers as I haven''t explicitly > logged in and got the session. > > I thought adding the following to the beginning of my methods in > the other controllers would be ok: > > post :login, "user" => { "login" => "username", "password" => > "testpass" } > assert_session_has "user" > > However, it assumes the current controller being tested. How do I > go through the other login/user controller before running through > these tests requiring user session data? > > Is there a way of simply setting the session data to bypass that test? > > Would much appreciate your help as I feeel I''m making strides on > this now but just need to get over this little hurdle. > > All the best > > Doug > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Maybe Matching Threads
- custom LLVM Pass with options fails to load
- custom LLVM Pass with options fails to load
- [LLVMdev] Splitting basic block results in unknown instruction type assertion
- [LLVMdev] is it impossible to use the external llvm custom pass on windows?
- What is this failure trying to tell me?