I just released version 0.2 of ARID (ActiveResourceIntegrationDsl) [formerly known as RestfulCrudIntegrationTester]. I've been working with this on three different projects for the past week and so far am very happy with it.
Besides the name change, there's a couple major enhancements.
This allows one call that runs through all the CRUD actions of a RESTful controller, assuming the controller doesn't do anything weird. So something like
napoleon.exercises_llama({:name => 'Tina'},{:name => 'Trisha'})
is equivalent to the 0.1 method of...
napoleon.creates_lama({:name => 'Tina'}) do |page|
@llama = page.assigns(:llama)
end
napoleon.reads_lama(@llama)
napoleon.updates_llama(@llama,{:name => {Trisha'})
napoleon.destroys_llama(@llama)
which runs through a big chunk of a simple RESTful controller's code
and views checking that forms are all setup correctly on new and edit
pages and that the controller properly processes the submitted forms
and respond with :success on reads and :redirect everything else.
Simply add {:via_ajax => true} to the options hash for the lower level goes_to (GET), posts_to and puts_to functions, and it'll pass it to your controller as an XML_HTTP_REQUEST, instead of a standard HTTP. It'll assert a :success, but It's up to you to check for anything else in the response. i.e.
napoleon.puts_to(llama_path(@llama),{:name => 'Pedro'},{:via_ajax => true}) do |page|
assert_equal('Pedro',page.assigns(:llama).name)
page.assert_select_rjs :replace_html, :llama
end

