I have some questions about testing RJS. First of all, just generally, how important is testing RJS? It seems, that for effects at least, if I can see that the effect is working, then that is good enough for me? I would like to test certain RJS redirect_to''s however. I came across the ARTS plugin. Has anyone had any experience using this with rails 2.2 or 2.3? I saw somewhere that it was included in 2.2, but when I try: assert_rjs :redirect_to, :action => ''show'' I get an unknown method error. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Apr 8, 10:31 am, David <dly...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have some questions about testing RJS. First of all, just > generally, how important is testing RJS? It seems, that for effects > at least, if I can see that the effect is working, then that is good > enough for me? I would like to test certain RJS redirect_to''s > however. I came across the ARTS plugin. Has anyone had any > experience using this with rails 2.2 or 2.3? I saw somewhere that it > was included in 2.2, but when I try: >I still use arts. I don''t think it is quite true to say that 2.2/2.3 (and I think 2.1) replaces arts, although it does have similar functionality via assert_select_rjs (don''t remember if that covers redirect_to though) I''d say testing is as important as it is elsewhere (although I would probably worry less about pure eye candy than about stuff that would impact usage (ie this div should be shown and this button enabled)). Fred> assert_rjs :redirect_to, :action => ''show'' > > I get an unknown method error.--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@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 -~----------~----~----~----~------~----~------~--~---
David wrote:> I have some questions about testing RJS. First of all, just > generally, how important is testing RJS? It seems, that for effects > at least, if I can see that the effect is working, then that is good > enough for me?In View testing in general, there are some overlapping rules of thumb: - do test what you don''t want to break - don''t test glitz (colors, shiny things, animated GIFs, etc.) - do test that your business-side variables got embedded correctly - do test navigation (such as links and redirect_to) The goal is if you add new features and make a mistake the code will break as early as possible. But if you break glitz, you can easily see it''s broke, and you can easily fix it without affecting your new features. > I would like to test certain RJS redirect_to''s> however. I came across the ARTS plugin. Has anyone had any > experience using this with rails 2.2 or 2.3?Yes; just install the plugin. After you start using assert_rjs, look up my assert_rjs_. It''s nearly a drop-in replacement for the most common RJS situations, but it''s much more powerful and accurate. http://groups.google.com/group/rubyonrails-talk/msg/c2fba12dd5e2735a It does not test redirect_to, but if it did then it would not be much more powerful than assert_rjs Classic, so use that for now. > I saw somewhere that it> was included in 2.2, but when I try: > > assert_rjs :redirect_to, :action => ''show'' > > I get an unknown method error.The documentation for the ARTS will tell you how to install a plugin. Something to do with script/plugin install... assert_rjs_ is a gem, not a plugin, because test-side things don''t need to deploy to your server. Use assert_rjs_ when you start working with replace_html. -- Phlip --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---