From ashley.moran at patchspace.co.uk Fri May 29 03:44:23 2009 From: ashley.moran at patchspace.co.uk (Ashley Moran) Date: Fri, 29 May 2009 08:44:23 +0100 Subject: [Celerity-users] session vars In-Reply-To: <412BB2DA-C1D9-4755-B0CB-8DBD0FFC94F7@dinshawdesign.com> References: <412BB2DA-C1D9-4755-B0CB-8DBD0FFC94F7@dinshawdesign.com> Message-ID: On 29 May 2009, at 04:27, Dinshaw Gobhai wrote: > Should I not be trying to check session vars with celerity or am I > missing something? Hi Dinshaw In general you don't even know that the session is in a cookie (it could be in a database, or filesystem, or anywhere). My 0.02 * $LOCAL_CURRENCY: When I use Cucumber + Celerity I always write the features so a human being can follow them, eg only by referring to page content, not div ids, and not accessing the database directly. Celerity is a web browser, and if you think of it as doing the same thing as you do when you click through the application (when the app is a black box to you), you'll write features that are much easier to understand. It also means if you refactor and move some data from the session to a temporary model, you won't break the features. Low-level stuff like that can be handled with RSpec examples. HTH Ashley -- http://www.patchspace.co.uk/ http://www.linkedin.com/in/ashleymoran http://aviewfromafar.net/ http://twitter.com/ashleymoran From jari.bakken at gmail.com Fri May 29 06:37:01 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Fri, 29 May 2009 12:37:01 +0200 Subject: [Celerity-users] session vars In-Reply-To: <412BB2DA-C1D9-4755-B0CB-8DBD0FFC94F7@dinshawdesign.com> References: <412BB2DA-C1D9-4755-B0CB-8DBD0FFC94F7@dinshawdesign.com> Message-ID: <9137FCE9-2C92-468F-9D6B-C0BC965AD4EC@gmail.com> On 29. mai. 2009, at 05.27, Dinshaw Gobhai wrote: > > (rdb:1) @browser.cookies['localhost'][0] > nil The confusion here seems to be caused by Culerity, in that it sets up RemoteObjectProxy objects also for simple elements like Arrays/Hashes (which probably makes sense if the user change them and expect that to happen on the JRuby side as well). But RemoteObjectProxy#inspect could be more informative. Anyway, @browser.cookies['localhost'] returns a Hash, not an Array. Without knowing the key you should be able to get to the elements by doing one of these @browser.coookies['localhost'].to_a @browser.coookies['localhost'].shift I do agree with Ashley when it comes to testing Rails apps though - stuff like this should be covered by unit tests/rspec. jb From jari.bakken at gmail.com Fri May 29 14:44:56 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Fri, 29 May 2009 20:44:56 +0200 Subject: [Celerity-users] Running Celerity from within TextMate In-Reply-To: <283B4C38-F263-4DA9-A01F-C3B112553A85@dinshawdesign.com> References: <412BB2DA-C1D9-4755-B0CB-8DBD0FFC94F7@dinshawdesign.com> <283B4C38-F263-4DA9-A01F-C3B112553A85@dinshawdesign.com> Message-ID: <74948418-B187-457A-9444-8F4F1E4F05E7@gmail.com> On 29. mai. 2009, at 20.13, Dinshaw Gobhai wrote: > Seems TextMate doesn't find jRuby that is set in $path. > The --require arguments are set in TextMate's preferences and single > features were running from TextMate before I started with Celerity. > This is really a TextMate question, but try this: 1. Create a new document in TextMate 2. Insert text: type jruby 3. Press Ctrl-R The output should be something like: jruby is /opt/jruby/latest/bin/jruby If you see something like /bin/bash: line 0: type: jruby: not found it means jruby is not in TextMate's PATH and you should read through this on how to set the path properly: http://manual.macromates.com/en/shell_commands#search_path jb