On Thu, Oct 15, 2009 at 8:52 PM, Chris Anderson <[email protected]> wrote: > On Thu, Oct 15, 2009 at 5:48 AM, Vlad GURDIGA <[email protected]> wrote: >> Hello! >> >> I'm trying to set up some acceptance tests for a $.CouchApp form like: >> - fill the form fields with some values; >> - submit the form and check the success; >> >> Right now (couchdb r825472) the form is submitted asynchronously, and, >> as far as I can see there is no way to cleanly automate form >> submission and check the result. >> >> For this purpose, I think it would be nice to have the opportunity to >> ask $.couch.db.saveDoc() to save the document asynchronously. >> As far as I could see in jquery.couch.js, this would need a few little >> changes (the patch is attached). > > I think you mean synchronously? The current behavior is async.
Ooops! Yeah, I just messed it up. You got it right, thanks! :) > It is hard to test that stuff. Let us know what you come up with. I want to think that it is not really that hard. Anyway, after I get over the jQuery issue* with the data() I will definitely let you know how thing are going. > > Ordinarily patches like this need to come through Jira. I'd apply it > but I think you can get the synchronous behavior without the patch. > See these docs: > > http://docs.jquery.com/Ajax/jQuery.ajaxSetup Yesss! That will surely do the trick! Thanks a lot! =) > > If this doesn't work for your purposes, I'd be happy to accept the > patch, but it'd be nice if it made the async option available across > all CouchDB Ajax calls. > > Chris > >> >> What do you think? >> > > > > -- > Chris Anderson > http://jchrisa.net > http://couch.io >
