Re: [rspec-users] Sinitra 0.9.1 Webrat 0.4.2 Cuc problem

2009-03-03 Thread Pat Nakajima
For what it's worth, here's how I had to hack Webrat to get my Sinatra 0.9.1 app working properly: http://gist.github.com/73735. On Tue, Mar 3, 2009 at 11:39 PM, Andrew Premdas wrote: > Have created sample sinatra cucumber app as suggested on wiki. Tried both > env.rb configurations from there a

Re: [rspec-users] Cucumber for large projects

2009-03-03 Thread Rich Morin
At 21:21 -0500 3/3/09, Remi Gagnon wrote: > > For now we are not having any tool to transfer > stories-scenarios from our word doc to rspec file. > If any of you have something for that, let me know. I don't have any software to offer, but I can offer a suggestion regarding process. If the "word"

[rspec-users] Testing my scripts?

2009-03-03 Thread Sebastian W.
Hello RSpec mailing list, I have a question which I'm sure someone here has a "duh!" answer to. :P A lot of the Ruby programming I do is around installing servers and automating various tasks. The pattern I use goes as follows, I'm sure you'll see where the gap is. Write a failing test. Write eno

[rspec-users] Sinitra 0.9.1 Webrat 0.4.2 Cuc problem

2009-03-03 Thread Andrew Premdas
Have created sample sinatra cucumber app as suggested on wiki. Tried both env.rb configurations from there and aslaks git repo. With this combination of gems I get the following error doing basic cuc tests When I visit '/foo' # features/step_definitions/gener

Re: [rspec-users] Cucumber for large projects

2009-03-03 Thread Stephen Eley
On Tue, Mar 3, 2009 at 5:06 AM, aidy lewis wrote: > > To me the user\customer should be involved in the creation of the > stories and the acceptance criteria and by producing a pdf later in > the cycle for those stakeholders to read and understand may be argued > as something that is not Story-Dri

Re: [rspec-users] Sinitra and Cucumber

2009-03-03 Thread Andrew Premdas
With Cuc and Rails I'd be able to debug step definitions by putting 'debugger' in the relevant step definition. With Sinatra configured as above this doesn't work. Any tips on making this work and/or explaining whats different/ Cheers Andrew 2009/2/27 Aslak Hellesøy > > > Aslak Hellesøy wrote

Re: [rspec-users] Cucumber for large projects

2009-03-03 Thread Remi Gagnon
Let me share my experience. On my side we do produce 3 documents before starting with rspec. 1- A web designer creates a design for a screen in conjunction with the marketing team and the analyst assigned to the this feature. The marketing dep, acts as the customer. 2-The analyst produce a "wor

Re: [rspec-users] Cucumber for large projects

2009-03-03 Thread Rich Morin
At 16:41 -0800 3/3/09, Pat Maddox wrote: > Not quite. Some customers don't want to sit down next to you as you > write the stories. In that situation, we'll talk about features, I > take notes, then I write up the features and ship them via email or > wiki. They're still involved in the creation

Re: [rspec-users] Cucumber for large projects

2009-03-03 Thread Pat Maddox
On Tue, Mar 3, 2009 at 2:06 AM, aidy lewis wrote: > Hi Matt/Dan > > 2009/3/2 Matt Wynne : > >> At the moment, IMO, the tools for feeding back the features to non-technical >> people are pretty immature. My colleague Dan Lucraft wrote a tool which >> produces a nicely-formatted PDF document from yo

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

2009-03-03 Thread Andrew Premdas
Zach By saying that models need the following case statement def by_role(role case role when "associate" when "admin" ... end your implying that the model is represented in a different way depending on the role. So in your case of invoices the associate's view

[rspec-users] Gherkin syntax notes (WIP)

2009-03-03 Thread Rich Morin
I made a start on some Gherkin syntax notes: http://wiki.github.com/aslakhellesoy/cucumber/gherkin Please look them over, fix errors, and/or send me a note about things I've missed or gotten wrong... -r -- http://www.cfcl.com/rdmRich Morin http://www.cfcl.com/rdm/resume r...@c

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

2009-03-03 Thread Zach Dennis
On Tue, Mar 3, 2009 at 12:32 PM, Pat Maddox wrote: > On Mon, Mar 2, 2009 at 8:35 PM, Stephen Eley wrote: >> On Mon, Mar 2, 2009 at 5:16 PM, Zach Dennis wrote: >>> >>> Forgot to mention what we did do. We ended up with the following... >>> >>> def index >>>  if user.has_role?("admin") >>>    user

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

2009-03-03 Thread Pat Maddox
On Mon, Mar 2, 2009 at 8:35 PM, Stephen Eley wrote: > On Mon, Mar 2, 2009 at 5:16 PM, Zach Dennis wrote: >> >> Forgot to mention what we did do. We ended up with the following... >> >> def index >>  if user.has_role?("admin") >>    user.in_role("admin").invoices >>  elsif user.has_role?("associat

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

2009-03-03 Thread Zach Dennis
On Tue, Mar 3, 2009 at 11:07 AM, Andrew Premdas wrote: > I think this discussion has gone backwards a bit. Here is what I think the > index method in the invoices controller should be like > > def index >   begin >    invoice.get_collection >   rescue >     # decide what to do if we can't get coll

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

2009-03-03 Thread Andrew Premdas
I think this discussion has gone backwards a bit. Here is what I think the index method in the invoices controller should be like def index begin invoice.get_collection rescue # decide what to do if we can't get collection end end Now clearly this needs some work to get it to work ..

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

2009-03-03 Thread James Byrne
Mark Wilden wrote: > > You do consolidate all your _access_ logic in one class, just as you > might consolidate all your sales tax knowledge in another class. That > way you have one source of responsibility for that behavior. > Otherwise, if you added, changed or deleted a role, you'd have to >

Re: [rspec-users] Changes in specs for routes in rspec 1.1.99.x

2009-03-03 Thread Jeremy Kleindl
GAh! easy one - I was adding the method argument to the 'route_for()' instead of the 'should ==' hash it compares the generated output with. And now I see how the script you made takes the single string argument from the old style and drops it into a hash that includes the restful method name. Than

Re: [rspec-users] Changes in specs for routes in rspec 1.1.99.x

2009-03-03 Thread Jeremy Kleindl
Thank you for posting this. Is this a script to replace/add arguments to the route_for methods in my current controller routing specs? Will the changes this script affects fix the errors I get when running specs like " route_for(_whatever_)should == '/foo/1' " on :update and :destroy actions genera

Re: [rspec-users] Cucumber for large projects

2009-03-03 Thread Matt Wynne
On 3 Mar 2009, at 10:06, aidy lewis wrote: Hi Matt/Dan 2009/3/2 Matt Wynne : At the moment, IMO, the tools for feeding back the features to non- technical people are pretty immature. My colleague Dan Lucraft wrote a tool which produces a nicely-formatted PDF document from your features f

Re: [rspec-users] Cucumber and selenium grid

2009-03-03 Thread Guilherme Machado Cirne
Ok. How about the html report generation when running features in parallel? I don't suppose there would be a single merged html report, correct? Thanks, -- Guilherme Machado Cirne gci...@gmail.com On Fri, Feb 27, 2009 at 10:21 PM, Mike Gaffney wrote: > You can configure webrat to use seleni

Re: [rspec-users] Cucumber for large projects

2009-03-03 Thread aidy lewis
Hi Matt/Dan 2009/3/2 Matt Wynne : > At the moment, IMO, the tools for feeding back the features to non-technical > people are pretty immature. My colleague Dan Lucraft wrote a tool which > produces a nicely-formatted PDF document from your features folder[1] which > is great, but won't work with

Re: [rspec-users] be_valid (validates_format_of ..., :on => :create)

2009-03-03 Thread Bart Zonneveld
On 2-mrt-2009, at 18:12, Mark Wilden wrote: On Mon, Mar 2, 2009 at 8:23 AM, Bart Zonneveld wrote: On a second note, I noticed rspec default generated model specs now use Model.create!(@valid_attributes) as their default "all is valid" test. What's the advantage of this approach? I just

Re: [rspec-users] Cucumber for large projects

2009-03-03 Thread Mischa Fierer
Speed will possibly become a big issue once you get above 1-2k steps or so. Testjour was written to solve this: http://github.com/brynary/testjour/tree/master While I haven't been able to use it myself, since I work mostly from home, it apparently radically reduces the time it takes to run feature

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

2009-03-03 Thread Mark Wilden
On Mon, Mar 2, 2009 at 10:34 PM, Stephen Eley wrote: > On Tue, Mar 3, 2009 at 1:04 AM, Mark Wilden wrote: >>  user.role.invoices > > Heh.  Which is what Zach said he wanted to do, and it isn't wrong. Actually, I thought Zach was talking about a method on User called in_role. > But it doesn't s