Hi, I want to write a functional test using the default test unit that is included with rails 3. Is there a way to skip a setup call? So I''m trying to test the users controller. But to access those actions, I need to be logged in. So I put a login algorithm in my setup. But I do not need to be logged in to create a new user. This is why I want to skip the setup call. Eric -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Jul 27, 7:59 pm, Eric Yen <e...-8z+dd/Dz1B1BDgjK7y7TUQ@public.gmane.org> wrote:> Hi, > > I want to write a functional test using the default test unit that is > included with rails 3. > Is there a way to skip a setup call? > > So I''m trying to test the users controller. > But to access those actions, I need to be logged in. So I put a login > algorithm in my setup. > But I do not need to be logged in to create a new user. This is why I > want to skip the setup call. >Either split those tests out into a different test class or look at something like shoulda for more flexibility around the contexts tests run in. Fred -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Quoting Eric Yen <eric-8z+dd/Dz1B1BDgjK7y7TUQ@public.gmane.org>:> Hi, > > I want to write a functional test using the default test unit that is > included with rails 3. > Is there a way to skip a setup call? > > So I''m trying to test the users controller. > But to access those actions, I need to be logged in. So I put a login > algorithm in my setup. > But I do not need to be logged in to create a new user. This is why I > want to skip the setup call. >Logout as the first step in the test, then try to create a new user. Or create another test file with no setup just for the test. Jeffrey -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Apparently Analagous Threads
- Did rails or shoulda go insane on the inflection of 'taxes'?
- Shoulda issue: no more "should have_instance_methods" ?
- Test errors in fuctional test after adding before_filter :login_required to controller
- Error of DEPRECATION WARNING
- has_many and belongs_to association