Pretty simple question, I''ve tried to ajaxify some actions and the first one I did was a delete - def delete_job ..... render :update do |page| page.remove "job_#{id}" end .... end and in my functional test I call this function via post def test.... post :delete_job, :id => 1 assert_response :success ...... end after the assert_response, how do I test that the page is deleting the job / div? I created some entries and ran this manually and it worked, but I don''t know what the assert is for the test. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 1 Apr 2008, at 16:55, Bob Br wrote:> > > after the assert_response, how do I test that the page is deleting the > job / div? I created some entries and ran this manually and it > worked, > but I don''t know what the assert is for the test.There''s assert_select_rjs and i''ve also used a plugin called arts Fred> -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:> There''s assert_select_rjs and i''ve also used a plugin called arts > FredForgot to say thank you eariler, that was exactly what I was looking for. Course heres a similar but new question - Now I''ve gotten more ajax and javascript calls going on. On one page there is a js function to remove an item from one list box, and a function to add the item to a second list box. render :update do |page| page.call "addNewElement", ''listbox_a'', ''id'', ''text'', ''value'' page.call "removeSelectedElemet", ''listbox_b'', ''id'', ''value'' end where ''value'' is the element id I''m working with. The xhr call goes off without a hitch, but I''m stumped how to write the functional test to make sure it works - it runs fine in a browser. I originally tried the assert_select_rjs but since there isn''t a insert or remove call in there, but a call to one of my own functions I''m not sure what function I should be using. In this same vein, how would you test that an alert box was fired? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Maybe Matching Threads
- Is it still possible to use should_have_rjs
- Functional tests with actions that send files
- [PATCH server] fixed functional tests after recent controller refactoring and managed node controller fixes.
- Can't test application controller methods in functional tests?
- some help with functional testing of nested routes