Re: [rspec-users] Loading numerous data structures from YAML files

2010-01-04 Thread Paul Hinze
Peter Hicks on 2010-01-02 at 16:13: > Hi Phillip > > Phillip Koebbe wrote: > >> Have you read about fixtures? It sounds like just what you're looking >> for. > > I'm using fixtures already - they're great. I can't find a way to load a > specific fixture in to a table. If I could do that, I coul

Re: [rspec-users] "RESTful" controller specs in rails

2010-01-04 Thread Tom Stuart
On 4 Jan 2010, at 22:46, Pat Maddox wrote: > I use resource_controller, and then don't need to write controller specs > because it's all boiler-plate. If I add any custom behavior that needs more > focused testing than cucumber provides, I can just write a couple specs to > cover it. Ditto: I

Re: [rspec-users] "RESTful" controller specs in rails

2010-01-04 Thread Pat Maddox
I use resource_controller, and then don't need to write controller specs because it's all boiler-plate. If I add any custom behavior that needs more focused testing than cucumber provides, I can just write a couple specs to cover it. Pat On Jan 4, 2010, at 11:16 AM, Nicolás Sanguinetti wrot

Re: [rspec-users] 'Expected NoMethodError, got NameError'

2010-01-04 Thread David Chelimsky
On Mon, Jan 4, 2010 at 2:57 PM, Andrew Premdas wrote: > 2009/12/30 Paul Hinze > > Given this simple cucumber feature (related to another rspec bug I am >> working on): >> >> http://gist.github.com/266335 >> >> I'm fighting with this error messages that _only_ shows up in certain >> situations t

Re: [rspec-users] 'Expected NoMethodError, got NameError'

2010-01-04 Thread Andrew Premdas
2009/12/30 Paul Hinze > Given this simple cucumber feature (related to another rspec bug I am > working on): > > http://gist.github.com/266335 > > I'm fighting with this error messages that _only_ shows up in certain > situations that I can't quite pin down (rake features breaks, individual > cu

[rspec-users] "RESTful" controller specs in rails

2010-01-04 Thread Nicolás Sanguinetti
So, what's the awesome sauce everyone is using for this? In the past I've used shared behaviors, and rspec_on_rails_on_crack to solve all the repetition in the controller specs, but I've been away from rspec for a while, and the controller specs in the rails project I'm working on are a mess. So… w

Re: [rspec-users] 'Expected NoMethodError, got NameError'

2010-01-04 Thread Tom Stuart
On 30 Dec 2009, at 21:04, Paul Hinze wrote: > I'm fighting with this error messages that _only_ shows up in certain > situations that I can't quite pin down Sounds eerily familiar: http://yehudakatz.com/2010/01/02/the-craziest-fing-bug-ive-ever-seen/ Cheers, -Tom ___

Re: [rspec-users] Question about structuring specs

2010-01-04 Thread Ijonas Kisselbach
Definitely helpful. Thanks, its much appreciated. On Mon, Jan 4, 2010 at 1:08 PM, David Chelimsky wrote: > On Mon, Jan 4, 2010 at 7:06 AM, Ijonas Kisselbach < > ijonas.kisselb...@gmail.com> wrote: > >> Hi David, >> >> Thanks for the suggestions... Yes I am mocking to avoid DB access, but if >> th

Re: [rspec-users] Question about structuring specs

2010-01-04 Thread David Chelimsky
On Mon, Jan 4, 2010 at 7:06 AM, Ijonas Kisselbach < ijonas.kisselb...@gmail.com> wrote: > Hi David, > > Thanks for the suggestions... Yes I am mocking to avoid DB access, but if > the cost is DB access vs. readability: I'll choose readability. > > Would you use something like Factory Girl or Machi

Re: [rspec-users] Question about structuring specs

2010-01-04 Thread Ijonas Kisselbach
Hi David, Thanks for the suggestions... Yes I am mocking to avoid DB access, but if the cost is DB access vs. readability: I'll choose readability. Would you use something like Factory Girl or Machinist to setup the DB? To avoid too much mocking and to avoid old-skool fixtures. Thanks for the he

Re: [rspec-users] Question about structuring specs

2010-01-04 Thread David Chelimsky
On Mon, Jan 4, 2010 at 5:26 AM, Ijonas Kisselbach < ijonas.kisselb...@gmail.com> wrote: > Hi David, > > I see your point about concentrating on outcomes rather than > implementation. I suppose who cares about implementation, its the effect > code on the "state of the world" that is important. > >

Re: [rspec-users] disabling before filters in rspec?

2010-01-04 Thread jollyroger
Hi David, well, the way you put it it all sounds totally logical...:-) Thanks a lot for the suggestions, I guess I need to improve my specs On Jan 4, 11:20 am, David Chelimsky wrote: > On Sun, Jan 3, 2010 at 6:56 PM, jollyroger > wrote: > > > > > Hey guys, > > > i have this before-filter i

Re: [rspec-users] Question about structuring specs

2010-01-04 Thread Ijonas Kisselbach
Hi David, I see your point about concentrating on outcomes rather than implementation. I suppose who cares about implementation, its the effect code on the "state of the world" that is important. Here's an unmodified sample: context ", when a new policy is activated on unchanged content" do

Re: [rspec-users] Question about structuring specs

2010-01-04 Thread David Chelimsky
On Mon, Jan 4, 2010 at 4:33 AM, Ijonas Kisselbach < ijonas.kisselb...@gmail.com> wrote: > Hi, > > I'm struggling with structuring my specs describing a large process in my > app. There are multiple paths of execution through that process each of > which I'm trying to describe using a different rsp

[rspec-users] Question about structuring specs

2010-01-04 Thread Ijonas Kisselbach
Hi, I'm struggling with structuring my specs describing a large process in my app. There are multiple paths of execution through that process each of which I'm trying to describe using a different rspec context, eg. describe Violation do context ", when nothing has changed since the last run"

Re: [rspec-users] disabling before filters in rspec?

2010-01-04 Thread David Chelimsky
On Sun, Jan 3, 2010 at 6:56 PM, jollyroger wrote: > Hey guys, > > i have this before-filter in my application-controller: > > def login_required >if !current_user > redirect_to join_welcome_path and return >end > end > > This before-filter is prepended before all other before-filter

[rspec-users] disabling before filters in rspec?

2010-01-04 Thread jollyroger
Hey guys, i have this before-filter in my application-controller: def login_required if !current_user redirect_to join_welcome_path and return end end This before-filter is prepended before all other before-filters in my application_controller.rb like this prepend_before_filt