… 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
test “blah blah blah”
:id => lots(:lot_one).to_param,
:use_part => parts(:part_three).to_param
xhr :post, :add_lot_to_assembly, :id => lots(:lot_one).to_param, :use_part => parts(:part_two).to_param assert_response :success
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
Am I misunderstanding this?
Is there some way to reinstantiate the controller prior to the 2nd xhr
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?