<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>validates_presence_of :purpose : Tag couchapp, everything about couchapp</title>
    <link>http://lenaherrmann.net</link>
    <language>en_US</language>
    <ttl>40</ttl>
    <description>Lena Herrmann</description>
    <item>
      <title>Ta-da! Here is my thesis.</title>
      <description>&lt;p&gt;I&amp;#8217;m happy to announce the immediate availability of my thesis! It was handed in in July 2010 as my diplom thesis in the academic program of Media Informatics at &lt;a href="http://www.beuth-hochschule.de/"&gt;Beuth Hochschule f&#252;r Technik Berlin&lt;/a&gt; (University of Applied Sciences). A &lt;a href="http://en.wikipedia.org/wiki/Diplom"&gt;German Diplom&lt;/a&gt; is comparable to a combined bachelor&amp;#8217;s and master&amp;#8217;s degree. Originally it has been written in German, so I&amp;#8217;m very happy it&amp;#8217;s also available for English speaking readers now: thanks a lot to the awesome &lt;a title="Copywriting, Translation" href="http://www.sanderstruck.com/"&gt;Sander Van de Moortel&lt;/a&gt; for translating it into English, and to &lt;a href="http://blog.couchone.com/post/1415269773/im-happy-to-announce-the-immediate-availability"&gt;CouchOne&lt;/a&gt; for sponsoring the translation. Read also &lt;a href="http://lenaherrmann.net/2010/08/05/thesis-is-done-thanks-for-your-support"&gt;my thank you notes&lt;/a&gt; for more gratefulness.&lt;/p&gt;


&lt;p&gt;I hope the thesis is an interesting read and useful for your research or development!&lt;/p&gt;


&lt;h3 style="color:#949490;margin-left:6px;"&gt;Contents&lt;/h3&gt;


&lt;p&gt;The title is &lt;b&gt;&amp;#8220;Implementation of a distributed application using the
document-oriented database CouchDB &#8212; An outliner as a replicable distributed system&amp;#8221;&lt;/b&gt; (originally &lt;b&gt;&amp;#8220;Umsetzung einer verteilten Anwendung mit der dokumentenorientierten Datenbank &#8212; CouchDB Ein Gliederungseditor als replizierbares Verteiltes System&amp;#8221;&lt;/b&gt;).&lt;/p&gt; 


&lt;p&gt;What is it about? &lt;a href="http://upstre.am/blog/2010/10/diplom-thesis-a-distributed-application-with-couchdb-and-javascript/"&gt;I wrote a couple of words about that&lt;/a&gt; for the Upstream blog. Here is also the abstract &#8212; all the contents in ten sentences:&lt;/p&gt;


&lt;p&gt;&lt;i&gt;Modern web browsers and mobile devices are capable of running complex applications that allow collaboration and data exchange between their users. Laptops and mobile phones, however, cannot be expected to keep their internet connections alive at all times. This problem can be sidestepped using data replication, which means that data are regularly synchronised and kept consistent. This thesis describes the drafting and prototypical development of a JavaScript application that uses the document-oriented database CouchDB to form distributed outliner software. Outliners can be used to record thoughts or concepts in a hierarchically structured manner. Apart from categorising the system to be developed and analysing possible approaches, the thesis will also examine the technologies used. Special focus lies on CouchDB with its built-in master-master replication and its ability to implement complex applications without the use of middleware. The final application runs locally in the browser and is therefore also usable when off-line. Conflicts are resolved when the system is synchronised, sometimes steered by user input. The thesis also evaluates the applicability of CouchDB in distributed applications with particular regard to the use case at hand.&lt;/i&gt;&lt;/p&gt;


&lt;h3 style="color:#949490;margin-left:6px;"&gt;Download&lt;/h3&gt;


&lt;p&gt;  
  &lt;ul&gt;
    &lt;li&gt;Read &lt;a href="http://www.scribd.com/doc/40221592/Implementation-of-a-distributed-application-using-the-document-oriented-database-CouchDB"&gt;the English version&lt;/a&gt; and &lt;a href="http://www.scribd.com/doc/40221773/Umsetzung-einer-verteilten-Anwendung-mit-der-dokumentenorientierten-Datenbank-CouchDB"&gt;the German version&lt;/a&gt; online,
    &lt;/li&gt;
    &lt;li&gt;check out the &lt;a href="https://github.com/lenalena/thesis_en"&gt;English LaTeX sources&lt;/a&gt; or the &lt;a href="https://github.com/lenalena/thesis_de"&gt;German LaTeX sources&lt;/a&gt; on github, or
    &lt;/li&gt;  
    &lt;li&gt;download the pdf &lt;a href="https://github.com/lenalena/thesis_en/raw/master/Lena_Herrmann_CouchDB_thesis.pdf"&gt;in English&lt;/a&gt; or &lt;a href="https://github.com/lenalena/thesis_de/raw/master/Lena_Herrmann_CouchDB_Diplomarbeit.pdf"&gt;in German&lt;/a&gt;.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/p&gt;


&lt;h3 style="color:#949490;margin-left:6px;"&gt;BibTeX&lt;/h3&gt;


&lt;p&gt;
  In case you want to quote me in your paper/thesis/homework, here&amp;#8217;s the BibTeX entry:
  
  &lt;div class="CodeRay"&gt;&lt;pre&gt;&lt;span class="CodeRay"&gt;@mastersthesis{herrmann:couchdb,
  author = {Lena Herrmann},
  title = {Realisation of a Distributed Application Using the Document-Oriented Database CouchDB - An Outliner as a Replicable Distributed System},
  school = {University of Applied Sciences Berlin},
  year = {2010},
  month = {July}
}

@mastersthesis{herrmann:couchdb,
  author = {Lena Herrmann},
  title = {Umsetzung einer verteilten Anwendung mit der dokumentenorientierten Datenbank CouchDB - Ein Gliederungseditor als replizierbares Verteiltes System},
  school = {Beuth Hochschule f&#252;r Technik Berlin},
  year = {2010},
  month = {Juli}
}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/p&gt;


&lt;h3 style="color:#949490;margin-left:6px;"&gt;The Application&lt;/h3&gt;


&lt;p&gt;The hands-on part is an outliner that allows people to collaborate on documents even when they don&amp;#8217;t have continuous internet access. If you want to read/clone/try out/improve/take apart/whatever the source code, &lt;a href="https://github.com/lenalena/doingnotes"&gt;it&amp;#8217;s here on github&lt;/a&gt;. &lt;a href="https://github.com/lenalena/doingnotes/blob/master/README.md"&gt;The github README&lt;/a&gt; contains installation and usage instructions, for more details read chapter 9, &amp;#8220;Application&amp;#8221;, in the thesis.&lt;/p&gt;


&lt;p&gt;You can also &lt;a href="http://lena.couchone.com:5984/doingnotes/_design/doingnotes/index.html"&gt;try out the outliner online&lt;/a&gt;. Though, in order to enjoy the replication and conflict resolution features, you have to (also) install it locally. But it&amp;#8217;s a couchapp - when you have CouchDB running you&amp;#8217;re almost there already.&lt;/p&gt;


&lt;p&gt;I hope you all like it!&lt;/p&gt;
</description>
      <pubDate>Wed, 27 Oct 2010 14:02:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:cd3cb76b-52bb-4dec-92a3-53c8b71cd46c</guid>
      <comments>http://lenaherrmann.net/2010/10/27/ta-da-here-is-my-thesis#comments</comments>
      <category>thesis</category>
      <category>couchdb</category>
      <category>javascript</category>
      <category>sammyjs</category>
      <category>couchapp</category>
      <trackback:ping>http://lenaherrmann.net/trackbacks?article_id=19</trackback:ping>
      <link>http://lenaherrmann.net/2010/10/27/ta-da-here-is-my-thesis</link>
    </item>
    <item>
      <title>Pretty URLs for you couchapp, the howto</title>
      <description>&lt;p&gt;If you have a couchapp and want to have nice URLS, go &lt;a href="http://blog.couchone.com/post/443028592/whats-new-in-apache-couchdb-0-11-part-one-nice-urls"&gt;read this blogpost&lt;/a&gt;. If you still don&amp;#8217;t get it, here is how to do it. It doesn&amp;#8217;t work with my outliner app, because it is so entangled with old couchapp and jquery.couch.js versions and I&amp;#8217;m not up to upgrade hell right now. But I&amp;#8217;ll write it down for my next project and for you, yay.&lt;/p&gt;


&lt;p&gt;Let&amp;#8217;s say you have an app running at http://account.couchone.com/mydb/_design/doingnotes/index.html and want to add the additional URL http://account.couchone.com/index.html. First you have to set up a virtual host. (Want to know why? Go back &lt;a href="http://blog.couchone.com/post/443028592/whats-new-in-apache-couchdb-0-11-part-one-nice-urls"&gt;read the blogpost&lt;/a&gt;). If you are using a hosted CouchDB instance and don&amp;#8217;t have access to the local.ini file, you can also do this remotely:

&lt;div class="CodeRay"&gt;&lt;pre&gt;&lt;span class="CodeRay"&gt;curl -X PUT http://username:password@account.couchone.com/_config/vhosts/account.couchone.com -d '&amp;quot;/mydb/_design/doingnotes/_rewrite&amp;quot;'&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/p&gt;


&lt;p&gt;Check at the bottom of http://account.couchone.com/_utils/config.html if there is a key value pair &amp;#8220;account.couchone.com&amp;#8221; =&gt; &amp;#8220;/mydb/_design/doingnotes/_rewrite&amp;#8221;.&lt;/p&gt;


&lt;p&gt;Now it won&amp;#8217;t work yet, because you still have to add the rewrite(s) to your design document. Do this by adding a file &amp;#8220;rewrites.json&amp;#8221; in your project folder. I has to contain an array of json objects with a &amp;#8220;from&amp;#8221; and a &amp;#8220;to&amp;#8221; attribute each. They work down in the path starting with the design document (the &amp;#8220;doingnotes&amp;#8221; in the URL). You can use wildcards. &amp;#8220;from&amp;#8221; specifies where it should map from, &amp;#8220;to&amp;#8221; which file it should map to. This is how rewrites.json looks for my application:

&lt;div class="CodeRay"&gt;&lt;pre&gt;&lt;span class="CodeRay"&gt;[{
  &lt;span class="ke"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;: &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,
  &lt;span class="ke"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;to&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;: &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;index.html&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
},
{
  &lt;span class="ke"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;: &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;vendor/*&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,
  &lt;span class="ke"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;to&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;: &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;vendor/*&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
},
{
  &lt;span class="ke"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;: &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;app/*&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,
  &lt;span class="ke"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;to&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;: &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;app/*&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
},
{
  &lt;span class="ke"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;: &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;config/*&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,
  &lt;span class="ke"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;to&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;: &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;config/*&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
},
{
  &lt;span class="ke"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;: &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;_view/*&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,
  &lt;span class="ke"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;to&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;: &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;_view/*&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
}]&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/p&gt;


&lt;p&gt;If you just put the first from/to pair in, you can already call the application, but it won&amp;#8217;t work because the code in the design document needs access to all the folders that are stored in the application&amp;#8217;s root level (that is not in the &amp;#8220;_attachments&amp;#8221; folder). The wildcards map everything down from that path. If you have code in other locations as well, you have to add rewrites for those folders too. That&amp;#8217;s it.&lt;/p&gt;
</description>
      <pubDate>Mon, 11 Oct 2010 15:34:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:8f61cf51-61c6-4e2e-a604-fe8277848cd1</guid>
      <comments>http://lenaherrmann.net/2010/10/11/pretty-urls-for-you-couchapp-the-howto#comments</comments>
      <category>couchdb</category>
      <category>couchapp</category>
      <trackback:ping>http://lenaherrmann.net/trackbacks?article_id=18</trackback:ping>
      <link>http://lenaherrmann.net/2010/10/11/pretty-urls-for-you-couchapp-the-howto</link>
    </item>
    <item>
      <title>Couchapp / Culerity glitches, part 1</title>
      <description>&lt;p&gt;Do you know what's behind these buzzwords: &lt;a href="http://couchdb.apache.org"&gt;CouchDB&lt;/a&gt; / &lt;a href="http://github.com/couchapp/couchapp"&gt;Couchapp&lt;/a&gt; / &lt;a href="http://code.quirkey.com/sammy/"&gt;Sammy.js&lt;/a&gt;? Not really? Then please look at this article now: &lt;a href="http://www.quirkey.com/blog/2009/09/15/sammy-js-couchdb-and-the-new-web-architecture"&gt;Sammy.js, CouchDB, and the new web architecture&lt;/a&gt;. The title says it all.&lt;/p&gt;


&lt;p&gt;This setup happens to be the field of my diploma thesis, friendly sponsored and supported by &lt;a href="http://upstream-berlin.com"&gt;Upstream&lt;/a&gt;. During the next months I'll develop a super duper thing with these technologies, and then I'll write 80 scientific pages about it. Yees, I'm not that much looking forward to the second part! Until then, I'm planning to semi-regularly blog about my findings.&lt;/p&gt;


&lt;p&gt;I'm not allowed to share the code before I have the diploma in my hands. But, because my workmate &lt;a href="http://twitter.com/bionadeholunder"&gt;Frank Proessdorf&lt;/a&gt; is so jealous of what I do, he and I started working on an app with a similar setup on our Upstream Research Fridays, to try things out. &lt;a href="http://github.com/lenalena/jsdoodle"&gt;Here it is&lt;/a&gt;. Don't expect anything yet.&lt;/p&gt;


&lt;p&gt;Today I'm going to tell you about some details of my testing setup. My *cough* supervising tutor &lt;a href="http://twitter.com/langalex"&gt;Alexander Lang&lt;/a&gt; already wrote down &lt;a href="http://upstream-berlin.com/2009/10/25/testing-couchapps-with-cucumber-and-culerity"&gt;all there is to know yet&lt;/a&gt; about Test-Driven Development with Cucumber-Culerity-Celerity and Couchapps.&lt;/p&gt;


&lt;p&gt;But there are a few things that will make your life hard, when the almost perfect Rails testing world has spoiled you as much as me. One thing is that we have to deal with a lot of asynchrony. Sammy renders the page, loads the data from the couch, and whenever the data is there it gets rendered into the page. The best way to do this is via callbacks. I'm going to write another blog post about that soon.&lt;/p&gt;


&lt;p&gt;In the integration test the problem is that celerity doesn't behave as it claims it does:&lt;/p&gt;

&lt;div class="CodeRay"&gt;&lt;pre&gt;&lt;span class="CodeRay"&gt;&lt;span class="gv"&gt;$browser&lt;/span&gt;.wait&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;is &lt;em&gt;supposed&lt;/em&gt; to make the test wait until everything is rendered completely. But for whatever reason it doesn't. The result is that your test fails because it searches for your expressions in an unfinished page.&lt;/p&gt;

&lt;p&gt;Because of that, in culerity we need something like:&lt;/p&gt;

&lt;div class="CodeRay"&gt;&lt;pre&gt;&lt;span class="CodeRay"&gt;sleep &lt;span class="fl"&gt;0.4&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;after every follow, press and go-to-path step. When using culerity in a Rails environment, this usually is enough. Sammy behaves a bit more unpredictable - it sometimes takes more than a whole second until everything is loaded.&lt;/p&gt;

&lt;p&gt;Solution? We can either increase the sleep time a lot, but that's not very nice, the features need long enough to run as it is. Fortunately we can use another method that's build into celerity: wait_while.&lt;/p&gt;

&lt;p&gt;I created a div "spinner" somewhere in index.html:
&lt;div class="CodeRay"&gt;&lt;pre&gt;&lt;span class="CodeRay"&gt; &lt;span class="ta"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="an"&gt;id&lt;/span&gt;=&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;spinner&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class="ta"&gt;&amp;gt;&lt;/span&gt;&lt;span class="ta"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;You can also add an actual spinner gif here. Just take care to place the div outside of your sammy element selector ("#main" by default), because this div gets replaced all the time.&lt;/p&gt;

&lt;p&gt;We need to show that div before every route that gets run. In application.js:
&lt;div class="CodeRay"&gt;&lt;pre&gt;&lt;span class="CodeRay"&gt;before(&lt;span class="kw"&gt;function&lt;/span&gt;() {
  &lt;span class="pd"&gt;$&lt;/span&gt;(&lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;#spinner&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;).show();
});&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;And we need to hide it after your rendering is completed. I haven't found an ideal solution where to do that, it depends on the application you are writing. As a quick and dirty fix, you can add it as a last line in sammy's partial function, in sammy.js:&lt;/p&gt;

&lt;div class="CodeRay"&gt;&lt;pre&gt;&lt;span class="CodeRay"&gt;partial: &lt;span class="kw"&gt;function&lt;/span&gt;(path, data, callback) {
  &lt;span class="c"&gt;//...&lt;/span&gt;
  &lt;span class="pd"&gt;$&lt;/span&gt;(&lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;#spinner&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;).hide();
},&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;I prefer to have more control about when I hide it, as my partial calls sometimes have nested callbacks. So I put it in application.js, resp. in my controllers, after each render call or in the partial callbacks. I admit this still sucks a bit.&lt;/p&gt;

&lt;p&gt;Finally, amend the cucumber step:&lt;/p&gt;

&lt;div class="CodeRay"&gt;&lt;pre&gt;&lt;span class="CodeRay"&gt;&lt;span class="co"&gt;When&lt;/span&gt; &lt;span class="rx"&gt;&lt;span class="dl"&gt;/&lt;/span&gt;&lt;span class="k"&gt;I wait for the AJAX call to finish&lt;/span&gt;&lt;span class="dl"&gt;/&lt;/span&gt;&lt;/span&gt; &lt;span class="r"&gt;do&lt;/span&gt;
  sleep &lt;span class="fl"&gt;0.2&lt;/span&gt;
  puts &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;Waiting for page to load ...&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class="r"&gt;if&lt;/span&gt; &lt;span class="gv"&gt;$browser&lt;/span&gt;.div(&lt;span class="sy"&gt;:id&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;spinner&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;).visible?
  &lt;span class="gv"&gt;$browser&lt;/span&gt;.wait_while { &lt;span class="gv"&gt;$browser&lt;/span&gt;.div(&lt;span class="sy"&gt;:id&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;spinner&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;).visible?} 
&lt;span class="r"&gt;end&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The browser still needs to sleep a bit before it actually finds the spinner div. But with this step in my common_culerity_steps.rb, the features finally run smoothly.&lt;/p&gt;</description>
      <pubDate>Wed, 04 Nov 2009 10:07:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:3e495ea7-1021-404e-b3ba-18267d409146</guid>
      <comments>http://lenaherrmann.net/2009/11/04/couchapp-culerity-glitches-part-1#comments</comments>
      <category>cucumber</category>
      <category>culerity</category>
      <category>celerity</category>
      <category>couchapp</category>
      <category>couchdb</category>
      <category>sammy.js</category>
      <category>javascript</category>
      <category>bug</category>
      <category>testing</category>
      <trackback:ping>http://lenaherrmann.net/trackbacks?article_id=6</trackback:ping>
      <link>http://lenaherrmann.net/2009/11/04/couchapp-culerity-glitches-part-1</link>
    </item>
  </channel>
</rss>

