... ok, I may be going about this the wrong way, or perhaps, a less
efficient way than is optimal, but I would like to test a little bit
of AJAX on one of my web pages.  When I test this by hand, I bring up
the page which shows a select box, I select an item from the drop down
list, see another select box show up, go back to the first select box,
select a different item, and see something different happen.

I have tried to script this up in my functional test with something like this:

test "blah blah blah"
    xhr :post,
        :add_lot_to_assembly,
        :id => lots(:lot_one).to_param,
        :use_part => parts(:part_three).to_param
    assert_response :success

    xhr :post,
        :add_lot_to_assembly,
        :id => lots(:lot_one).to_param,
        :use_part => parts(:part_two).to_param
    assert_response :success
end

The problem is, there is an instance variable in my controller that is
set during the handling of the first #add_lot_to_assembly action.  It
remains set for the second invocation of #xhr.  This makes me think
that the controller instance is not reinstantiated between calls to
#xhr.

Am I misunderstanding this?

Is there some way to reinstantiate the controller prior to the 2nd xhr call?

Is there a better way to have structured my functional test?

Should I be using something other than a functional test to test this
sort of behavior?

--wpd

--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to