couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Anderson <jch...@apache.org>
Subject Re: async saveDoc
Date Fri, 16 Oct 2009 05:40:21 GMT
On Thu, Oct 15, 2009 at 8:13 PM, Vlad GURDIGA <gurdiga@gmail.com> wrote:
> Yeah, Chris' tip definitely solved my problem!
>
> OK, here is how it looks in the code to verify the result of a form submit:
>
> Cozy.checkSubmit(form).into(sandbox); *
>
> * http://github.com/gurdiga/cozy/blob/master/_attachments/tests/book.js#L19
>
> and here are the internals:
> http://github.com/gurdiga/cozy/blob/master/_attachments/qunit/cozy.js#L62
>
> Yeah, I know: it's sweet! =)
>

You're definitely getting somewhere here. Keep us posted.

> On Thu, Oct 15, 2009 at 8:52 PM, Chris Anderson <jchris@apache.org> wrote:
>> On Thu, Oct 15, 2009 at 5:48 AM, Vlad GURDIGA <gurdiga@gmail.com> 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.
>>
>> It is hard to test that stuff. Let us know what you come up with.
>>
>> 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
>>
>> 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
>>
>



-- 
Chris Anderson
http://jchrisa.net
http://couch.io

Mime
View raw message