Update, see below the answer to the blue question, this is the correct answer
Could you use Capybara to test integration? I found that ajax is hard to test with rspec only. In your case, I'm not even sure that you still got the answer. In capybara, it waits for the ajax call to complete, and you can call page.has_xxxx to see if it is updated. Here is an example:
it "should flash a successful message" do visit edit_gallery_path(@gallery) fill_in "gallery_name", :with => "testvalue" click_button("Update") page.has_selector?("div#flash", :text => "Gallery updated.") page.has_content?("Gallery updated") click_link "Sign out" end
James
source share