Re: [rspec-users] Run cucumber on a different DB than test?

2009-02-28 Thread Matt Wynne
On 27 Feb 2009, at 19:56, Forrest Chang wrote: - Original Message Date: Fri, 27 Feb 2009 16:41:53 + From: Matt Wynne Please let me know how you get on running them in parallel for CI, as I'd also like to do this. At the moment we just use the two environments for faster feedba

Re: [rspec-users] Run cucumber on a different DB than test?

2009-02-28 Thread Matt Wynne
On 27 Feb 2009, at 19:59, Forrest Chang wrote: Hi Matt: Yeah, and certain rake tasks won't work, if I recall properly. RAILS_ENV=another_env rake db:test:prepare still reset the test database, not the db in another_env. Scott Indeed. I do have a fully-functioning rake db:features:prepare

Re: [rspec-users] How do you mock a local variable (#2) ?

2009-02-28 Thread Zach Dennis
On Fri, Feb 27, 2009 at 3:35 PM, MathLef wrote: > Hi, Hi Mathieu, > > I need help to spec a local variable in a controller. I have been > wandering how I can do that since all I have done so far is useless. > Note that the code is in a controller and that it is not yet finished > since I am tryi

Re: [rspec-users] How do you mock a local variable (#2) ?

2009-02-28 Thread Zach Dennis
On Sat, Feb 28, 2009 at 11:49 AM, Mathieu LeFrancois wrote: > Zach, the "cle" variable you ask for should have been read as "key". The > word "clé" is the French translation for the word "key". I changed it, but > obviously forgot instances, for you guys to understand the code since you > might no

Re: [rspec-users] How do you mock a local variable (#2) ?

2009-02-28 Thread Mathieu LeFrancois
Zach, the "cle" variable you ask for should have been read as "key". The word "clé" is the French translation for the word "key". I changed it, but obviously forgot instances, for you guys to understand the code since you might not be familiar with French. ;-) Thank you all for your good advices.

[rspec-users] [rails] An authorization question

2009-02-28 Thread Chris Flipse
I've been going back over some legacy code, backfilling tests, and I'm encountering something that is causing no small amount of pain. This is in a mature Rails app, that's lived and migrated from 1.1 through to 2.1, so there's a lot of ancient cruft built up in the corners that I've been trying

Re: [rspec-users] specing send_file

2009-02-28 Thread vo.x
Uhh, sorry ... I will give it a try! Thank you for your help. Vit On 26 Ún, 15:29, David Chelimsky wrote: > On Thu, Feb 26, 2009 at 7:13 AM, vo.x wrote: > > On 25 Ún, 16:18, David Chelimsky wrote: > >> On Wed, Feb 25, 2009 at 8:20 AM, vo.x wrote: > >> > Aha, it seems that there is differen

Re: [rspec-users] [rails] An authorization question

2009-02-28 Thread David Chelimsky
On Sat, Feb 28, 2009 at 11:52 AM, Chris Flipse wrote: > I've been going back over some legacy code, backfilling tests, and I'm > encountering something that is causing no small amount of pain.  This is in > a mature Rails app, that's  lived and migrated from 1.1 through to 2.1, so > there's a lot

Re: [rspec-users] [rails] An authorization question

2009-02-28 Thread Chris Flipse
On Sat, Feb 28, 2009 at 1:38 PM, David Chelimsky wrote: > On Sat, Feb 28, 2009 at 11:52 AM, Chris Flipse wrote: > > I've been going back over some legacy code, backfilling tests, and I'm > > encountering something that is causing no small amount of pain. This is > in > > a mature Rails app, that

Re: [rspec-users] [rails] An authorization question

2009-02-28 Thread David Chelimsky
On Sat, Feb 28, 2009 at 12:51 PM, Chris Flipse wrote: > > > On Sat, Feb 28, 2009 at 1:38 PM, David Chelimsky > wrote: >> >> On Sat, Feb 28, 2009 at 11:52 AM, Chris Flipse wrote: >> > I've been going back over some legacy code, backfilling tests, and I'm >> > encountering something that is causin

[rspec-users] [RSpec] [Rails] [BDD]

2009-02-28 Thread julian mann
Hello, My first time here, and I'm pretty new to rspec, and indeed BDD/TDD, so bear with me I am trying to spec a fairly simple controller update action for an account. The account belongs_to :user and user has_one :account. the route is PUT: /users/1/account here's the action def update

Re: [rspec-users] [rails] An authorization question

2009-02-28 Thread Chris Flipse
I've actually been okay with it at the unit testing / rspec level -- I've had it stubbed as you describe for a while. The pain point came in as I was trying to setup data for Cucumber ... Which, listening to my tests, tells me that the current structure is bad. I was more curious to see how other

[rspec-users] testing multiple sessions in cucumber/webrat

2009-02-28 Thread Joe Van Dyk
Is it possible to have a scenario where you are testing the interaction between two different session? i.e. Given User A clicks this link Then User B should see this It used to be possible, but don't know if it still is. Joe ___ rspec-users mailing li

Re: [rspec-users] [RSpec] [Rails] [BDD]

2009-02-28 Thread Ben Mabey
julian mann wrote: Hello, My first time here, and I'm pretty new to rspec, and indeed BDD/TDD, so bear with me Welcome Julian! See my comments inline below... I am trying to spec a fairly simple controller update action for an account. The account belongs_to :user and user has_one :accoun

[rspec-users] cucumber ambiguous match

2009-02-28 Thread Joe Van Dyk
Ambiguous match of "a volunteer 'Joe' from 'Cincinnati'": features/step_definitions/user_steps.rb:1:in `/^a volunteer '(.*)'$/' features/step_definitions/user_steps.rb:5:in `/^a volunteer '(.*)' from '(.*)'$/' Don't see how that's ambiguous.

Re: [rspec-users] [rails] An authorization question

2009-02-28 Thread Ben Mabey
Chris Flipse wrote: I've actually been okay with it at the unit testing / rspec level -- I've had it stubbed as you describe for a while. The pain point came in as I was trying to setup data for Cucumber ... Which, listening to my tests, tells me that the current structure is bad. I was more

Re: [rspec-users] cucumber ambiguous match

2009-02-28 Thread Joe Van Dyk
nevermind, I see it. On Sat, Feb 28, 2009 at 12:59 PM, Joe Van Dyk wrote: >      Ambiguous match of "a volunteer 'Joe' from 'Cincinnati'": > >      features/step_definitions/user_steps.rb:1:in `/^a volunteer '(.*)'$/' >      features/step_definitions/user_steps.rb:5:in `/^a volunteer > '(.*)' fro

Re: [rspec-users] [rails] An authorization question

2009-02-28 Thread Zach Dennis
On Sat, Feb 28, 2009 at 2:54 PM, Chris Flipse wrote: > I've actually been okay with it at the unit testing / rspec level -- I've > had it stubbed as you describe for a while. > > The pain point came in as I was trying to setup data for Cucumber ... Which, > listening to my tests, tells me that the

[rspec-users] Rspecing an enumerator from outside-in woes

2009-02-28 Thread Shot (Piotr Szotkowski)
I’m trying to spec a system from outside-in as an excercise in ‘emergent design’ – and so far I love it; it made me think about the design for two days before I even wrote the first spec… :) My most-outside class seems to be a prime candidate for an #each method. The attached (stripped) spec ca

Re: [rspec-users] [rails] An authorization question

2009-02-28 Thread Chris Flipse
On Sat, Feb 28, 2009 at 4:34 PM, Zach Dennis wrote: > > Disclaimer, this entire post has to deal with model level > authorization and a technique I've been using and evolving in Rails > projects. It has nothing to do with your issue of global state for > what User is logged in. Onto the fun stuff

Re: [rspec-users] [rails] An authorization question

2009-02-28 Thread Chris Flipse
On Sat, Feb 28, 2009 at 3:42 PM, Ben Mabey wrote: > Chris Flipse wrote: > >> I've actually been okay with it at the unit testing / rspec level -- I've >> had it stubbed as you describe for a while. >> >> The pain point came in as I was trying to setup data for Cucumber ... >> Which, listening to

Re: [rspec-users] [RSpec] [Rails] [BDD]

2009-02-28 Thread julian mann
> Welcome Julian! See my comments inline below... Thanks Ben! > > >> I am trying to spec a fairly simple controller update action for an >> account. The account belongs_to :user and user has_one :account. >> >> >> here's the action >> >> def update >>@account = @user.account >>respond_

Re: [rspec-users] testing multiple sessions in cucumber/webrat

2009-02-28 Thread BJ Clark
Joe,I would test this in 2 steps. I'd first test that whatever state change (or whatever happens when you User A clicks the link) takes place. Then in another test, I'd check that, given a certain state (or again, whatever is supposed to happen), then User B sees whatever. HTH, BJ Clark On Sat,

Re: [rspec-users] cucumber ambiguous match

2009-02-28 Thread Ben Mabey
Joe Van Dyk wrote: Ambiguous match of "a volunteer 'Joe' from 'Cincinnati'": features/step_definitions/user_steps.rb:1:in `/^a volunteer '(.*)'$/' features/step_definitions/user_steps.rb:5:in `/^a volunteer '(.*)' from '(.*)'$/' Don't see how that's ambiguous. ___

Re: [rspec-users] Rspecing an enumerator from outside-in woes

2009-02-28 Thread Ben Mabey
Shot (Piotr Szotkowski) wrote: I’m trying to spec a system from outside-in as an excercise in ‘emergent design’ – and so far I love it; it made me think about the design for two days before I even wrote the first spec… :) My most-outside class seems to be a prime candidate for an #each method.

Re: [rspec-users] [RSpec] [Rails] [BDD]

2009-02-28 Thread Ben Mabey
When you use instance_variable_set you are setting the variable inside the example group (the test) and not the actual controller it self. Ah ok - got it now. Thanks for clearing that up ! Although it does leave me slightly confused as to what the object is that performs the te

Re: [rspec-users] Rspecing an enumerator from outside-in woes

2009-02-28 Thread Shot (Piotr Szotkowski)
Ben Mabey: > Hmm.. maybe this is what you are looking for (From > http://rspec.info/documentation/mocks/message_expectations.html): Thanks for your interest and the pointer, but my questions weren’t about how to make my mocks yield to the code that calls them – if you look at the code I attac

Re: [rspec-users] Rspecing an enumerator from outside-in woes

2009-02-28 Thread Ben Mabey
Shot (Piotr Szotkowski) wrote: Ben Mabey: Hmm.. maybe this is what you are looking for (From http://rspec.info/documentation/mocks/message_expectations.html): Thanks for your interest and the pointer, but my questions weren’t about how to make my mocks yield to the code that calls t

Re: [rspec-users] cucumber ambiguous match

2009-02-28 Thread Mark Wilden
On Sat, Feb 28, 2009 at 5:54 PM, Ben Mabey wrote: > Joe Van Dyk wrote: >>      Ambiguous match of "a volunteer 'Joe' from 'Cincinnati'": >> >>      features/step_definitions/user_steps.rb:1:in `/^a volunteer '(.*)'$/' >>      features/step_definitions/user_steps.rb:5:in `/^a volunteer >> '(.*)' fr