Re: [rspec-users] route_for testing multiple request methods

2009-04-09 Thread David Chelimsky
On Fri, Apr 10, 2009 at 2:08 AM, Brandon Olivares wrote: > Hi, > > I'm trying to use route_for to test my routes. I have two routes that have > the same path, but different request methods. > > map.with_options :controller => 'contact' do |c| >  c.contact 'contact.html', :action => 'index', >  :co

Re: [rspec-users] Then I should be on /users/3/posts/8/comments/2/edit

2009-04-09 Thread Ben Mabey
Gavin Hughes wrote: "Then I should be on /users/3/posts/8/comments/2/edit" What's the solution for parsing out and matching and arbitrarily deep nested route? Hi Gavin, Let me try to answer your question without actually answering it. :) I generally don't test my URLs. IMO, for the majorit

Re: [rspec-users] Then I should be on /users/3/posts/8/comments/2/edit

2009-04-09 Thread Gavin Hughes
Ben, Josh Makes perfect sense. The user won't be looking at the URL. He'll expect some result on the page, thus we test for that. Thanks! Gavin -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://

[rspec-users] route_for testing multiple request methods

2009-04-09 Thread Brandon Olivares
Hi, I'm trying to use route_for to test my routes. I have two routes that have the same path, but different request methods. map.with_options :controller => 'contact' do |c| c.contact 'contact.html', :action => 'index', :conditions => {:method => :get} c.process_contact_form 'contact.html',

Re: [rspec-users] Then I should be on /users/3/posts/8/comments/2/edit

2009-04-09 Thread Pat Maddox
I'm not sure, cause I've never tried to write a step like that. I would rather do Then I should see "Editing 'My sweet comment'" Even better would be to actually edit the comment and make sure that it changed. So maybe When I edit the comment to be "My new comment" Then I should see "My new com

Re: [rspec-users] Then I should be on /users/3/posts/8/comments/2/edit

2009-04-09 Thread Josh Knowles
On Thu, Apr 9, 2009 at 11:27 PM, Gavin Hughes wrote: > The problem is actually this: > > And I fill in ... > And I press "Create Comment" > Then I should be on [the correct page, ie. > /users/3/posts/8/comments/2/edit] > > How do you write a step for that? Personally I try and stay away from step

Re: [rspec-users] Then I should be on /users/3/posts/8/comments/2/edit

2009-04-09 Thread Ben Mabey
Gavin Hughes wrote: The problem is actually this: And I fill in ... And I press "Create Comment" Then I should be on [the correct page, ie. /users/3/posts/8/comments/2/edit] How do you write a step for that? I just saw this second message.. My assumption about what you were testing was of

[rspec-users] Eliminating duplication from tests

2009-04-09 Thread Brandon Olivares
Hi, Lately I've found myself trying to reduce typing as much as possible, so when I have a lot of tests that only differ in a few variables, I tend to abstract them to reduce typing. For instance, I have an assert_form_errors method that I call within a describe block to ensure the proper errors

Re: [rspec-users] Then I should be on /users/3/posts/8/comments/2/edit

2009-04-09 Thread Gavin Hughes
The problem is actually this: And I fill in ... And I press "Create Comment" Then I should be on [the correct page, ie. /users/3/posts/8/comments/2/edit] How do you write a step for that? -- Posted via http://www.ruby-forum.com/. ___ rspec-users maili

[rspec-users] Then I should be on /users/3/posts/8/comments/2/edit

2009-04-09 Thread Gavin Hughes
"Then I should be on /users/3/posts/8/comments/2/edit" What's the solution for parsing out and matching and arbitrarily deep nested route? -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.

[rspec-users] Cucover: coverage-aware 'lazy' cucumber runs

2009-04-09 Thread Matt Wynne
Hi Folks, This is an idea I've been playing with for some time, and I think I've finally it into a shape where it might be useful to other people. Cucover is a thin wrapper for Cucumber which makes it lazy. What does it mean for Cucumber to be lazy? It will only run a feature if it needs t

[rspec-users] [cucumber] Cucumber and restful_authentication

2009-04-09 Thread Tadatoshi Takahashi
Hi, I have just started to use Cucumber. I'm struggling to use Cucumber on the feature that is available only to the logged in user. Could anybody provide the codes that need to be added? The sites I found by Google search don't give clear information about what to do. The ones I found are: ht

[rspec-users] [cucumber] Cucumber and restful_authentication

2009-04-09 Thread Tadatoshi Takahashi
Hi, I have just started to use Cucumber. I'm struggling to use Cucumber on the feature that is available only to the logged in user. Could anybody provide the codes that need to be added? The sites I found by Google search don't give clear information about what to do. The ones I found are: ht

Re: [rspec-users] [Cucumber] Welcome Ben Mabey to the official Cucumber team

2009-04-09 Thread Luke Melia
On Apr 7, 2009, at 5:19 PM, aslak hellesoy wrote: The core Cucumber team now consists of Joseph Wilk, Ben Mabey and myself. Welcome Ben! Great choice, great team. Thanks for all your hard work, gentlemen. -- Luke Melia l...@lukemelia.com http://www.lukemelia.com/ ___

Re: [rspec-users] Reuse of Cucumber Features

2009-04-09 Thread Matt Wynne
On 9 Apr 2009, at 20:36, Zach Dennis wrote: On Thu, Apr 9, 2009 at 3:30 PM, Zach Dennis wrote: On Thu, Apr 9, 2009 at 2:56 PM, Matt Wynne wrote: On 9 Apr 2009, at 17:47, Zach Dennis wrote: On Thu, Apr 9, 2009 at 9:29 AM, Williams, Wesley wrote: Matt, Hmm, I think this is one way to

Re: [rspec-users] [cucumber, jruby] Same steps are being added multiple times?

2009-04-09 Thread John Goodsen
I understand how this happens when I *really do* have ambiguous steps, but in my simple case, I don't. I only have a single class which contains steps (attached below). I can run a single scenario just fin, but when I try to run multiple scenarios in one run, I get Ambiguous step errors. It's li

Re: [rspec-users] Reuse of Cucumber Features

2009-04-09 Thread Matt Wynne
On 9 Apr 2009, at 17:47, Zach Dennis wrote: On Thu, Apr 9, 2009 at 9:29 AM, Williams, Wesley wrote: Matt, Hmm, I think this is one way to do it. I will need to get my customer to think differently about defining the requirements. They really like the tables. Some times table just wo

Re: [rspec-users] Reuse of Cucumber Features

2009-04-09 Thread Zach Dennis
On Thu, Apr 9, 2009 at 3:30 PM, Zach Dennis wrote: > On Thu, Apr 9, 2009 at 2:56 PM, Matt Wynne wrote: >> >> On 9 Apr 2009, at 17:47, Zach Dennis wrote: >> >>> On Thu, Apr 9, 2009 at 9:29 AM, Williams, Wesley >>> wrote: Matt, Hmm, I think this is one way to do it.  I will nee

Re: [rspec-users] Testing page layouts

2009-04-09 Thread Zach Dennis
On Thu, Apr 9, 2009 at 2:55 PM, James Byrne wrote: > This is a question of technique.  To what degree do projects generally > test page/report layouts?  Do you just check to see if the expected data > is present or do you also check that the layout is presentable? We use humans to check layout an

[rspec-users] [cucumber][rails] trouble with authlogic tests

2009-04-09 Thread scott
i am trying to learn testing for rails apps. i followed the two authlogic tutorials (basic authlogic setup and password reset) and now i am trying to add some integration tests with cucumber (i know you are supposed to do the tests 1st, but i am just trying to figure out how things work). i found

Re: [rspec-users] Reuse of Cucumber Features

2009-04-09 Thread Zach Dennis
On Thu, Apr 9, 2009 at 2:56 PM, Matt Wynne wrote: > > On 9 Apr 2009, at 17:47, Zach Dennis wrote: > >> On Thu, Apr 9, 2009 at 9:29 AM, Williams, Wesley >> wrote: >>> >>> Matt, >>> >>> Hmm, I think this is one way to do it.  I will need to get my customer >>> to think differently about defining th

[rspec-users] Testing page layouts

2009-04-09 Thread James Byrne
This is a question of technique. To what degree do projects generally test page/report layouts? Do you just check to see if the expected data is present or do you also check that the layout is presentable? -- Posted via http://www.ruby-forum.com/. ___

Re: [rspec-users] [cucumber, jruby] Same steps are being added multiple times?

2009-04-09 Thread James Byrne
John Goodsen wrote: > > but when I run my tests with: jruby -S cucumber -r > stories/support/env.rb > > I am getting Ambiguous match of my steps - but I only have a single > class of steps, NavigationSteps. > > any ideas what's going on? You have two (or more) step matchers that match a sin

[rspec-users] [cucumber, jruby] Same steps are being added multiple times?

2009-04-09 Thread John Goodsen
Hi all, I'm not quite sure I understand how env.rb is loaded in the cucumber/jruby world. I have a directory structure like this: stories/fulfillment_status_tracking stories/fulfillment_status_tracking/main_success.feature stories/fulfillment_status_tracking/test.feature stories/regular_billme_s

Re: [rspec-users] [cucumber] Tests pass, application does not.

2009-04-09 Thread James Byrne
Pat Maddox wrote: > > > I just did a github search and the only place I found method_exists? > referenced was in mocha. So my guess is that in test mode, mocha is > being loaded and so it's passing for you. Try using respond_to? > instead of method_exists? I've never even heard of method_exists

Re: [rspec-users] [cucumber] Tests pass, application does not.

2009-04-09 Thread David Chelimsky
On Thu, Apr 9, 2009 at 2:48 PM, Joseph Wilk wrote: > > James Byrne wrote: >> >> James Byrne wrote: >> >>> >>> This has just cropped up this morning and I have no clue as to what is >>> causing it. >>> >>> Here is the error when running the application through the web browser >>> in development: >>

Re: [rspec-users] [cucumber] Tests pass, application does not.

2009-04-09 Thread David Chelimsky
On Thu, Apr 9, 2009 at 1:55 PM, Pat Maddox wrote: > On Thu, Apr 9, 2009 at 9:46 AM, James Byrne wrote: >> This has just cropped up this morning and I have no clue as to what is >> causing it. >> >> Here is the error when running the application through the web browser >> in development: >> >>  un

Re: [rspec-users] [cucumber] Tests pass, application does not.

2009-04-09 Thread Joseph Wilk
James Byrne wrote: James Byrne wrote: This has just cropped up this morning and I have no clue as to what is causing it. Here is the error when running the application through the web browser in development: undefined method `method_exists?' for # I put in a print self.methods.sort

Re: [rspec-users] [cucumber] Tests pass, application does not.

2009-04-09 Thread James Byrne
James Byrne wrote: > This has just cropped up this morning and I have no clue as to what is > causing it. > > Here is the error when running the application through the web browser > in development: > > undefined method `method_exists?' for # I put in a print self.methods.sort.to_yaml and, sure

Re: [rspec-users] updated to latest gems, rspec not catching flash.now

2009-04-09 Thread doug livesey
Didn't spot this when you replied earlier -- cheers for that! Doug. 2009/4/8 Zach Dennis > On Wed, Apr 8, 2009 at 2:08 PM, doug livesey wrote: > > Hi, after an update to all the latest gems, I have a controller spec > failing > > that wasn't previously: > >flash[:alert].should eql( "Blah

Re: [rspec-users] [Cucumber] Welcome Ben Mabey to the official Cucumber team

2009-04-09 Thread Tim Walker
Three Cucumberists! You're just an onion short of a salad! Best regards, and congratulations Ben! Tim On Apr 8, 2009 3:14 AM, "Matt Wynne" wrote: On 7 Apr 2009, at 22:19, aslak hellesoy wrote: > Ben Mabey has accepted my invitation to be on the... Nice one Ben :) Matt Wynne http://blog.mattwy

Re: [rspec-users] [cucumber] Tests pass, application does not.

2009-04-09 Thread Pat Maddox
On Thu, Apr 9, 2009 at 9:46 AM, James Byrne wrote: > This has just cropped up this morning and I have no clue as to what is > causing it. > > Here is the error when running the application through the web browser > in development: > >  undefined method `method_exists?' for # > > /usr/lib64/ruby/ge

Re: [rspec-users] [Cucumber] Bug?

2009-04-09 Thread Ben Mabey
Fedor Fomenko wrote: Hello, I have the following step for checking that a validation message is displayed on screen: Then /^(.+) should be displayed$/ do |error| msg = @browser.ul(:class, 'validation-summary-errors').li(:text, error) #pp msg.text msg.should_not == nil end I run scenario

Re: [rspec-users] Reuse of Cucumber Features

2009-04-09 Thread Zach Dennis
On Thu, Apr 9, 2009 at 9:29 AM, Williams, Wesley wrote: > Matt, > > Hmm, I think this is one way to do it.  I will need to get my customer > to think differently about defining the requirements.  They really like > the tables. Some times table just work best. I love writing scenarios with natural

[rspec-users] [cucumber] Tests pass, application does not.

2009-04-09 Thread James Byrne
This has just cropped up this morning and I have no clue as to what is causing it. Here is the error when running the application through the web browser in development: undefined method `method_exists?' for # /usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/attribute_methods.

Re: [rspec-users] possible to stub params hash ?

2009-04-09 Thread Andrea Jahn
The stub for params was the reason, that put :update has called the index action. Now I pass the params directly in and it works fine: put :update, :pl_planning => {"title" => "Project 1"} Scott, thanks a lot for the tip !!! Andrea *Von:* "Andrea Jahn" *Gesendet:* 09.04.09 16:03:53 *A

Re: [rspec-users] possible to stub params hash ?

2009-04-09 Thread Andrea Jahn
Hi, I tried to stub the params method of the Controller because I got the error " You have a nil object when you didn't expect it!" for the access to params[:pl_planning]["item_model_version_id"] in the update action. I thought, that the stubbing is not working because of the following error:

Re: [rspec-users] Reuse of Cucumber Features

2009-04-09 Thread Williams, Wesley
Matt, Hmm, I think this is one way to do it. I will need to get my customer to think differently about defining the requirements. They really like the tables. Thanks, Wes -Original Message- From: rspec-users-boun...@rubyforge.org [mailto:rspec-users-boun...@rubyforge.org] On Behalf Of

Re: [rspec-users] Reuse of Cucumber Features

2009-04-09 Thread Williams, Wesley
I have similar concerns. I am coming from a background in Fit/FitNesse so I am use to the table idea but I am not completely convinced it is better. I really appreciate all the feedback I am getting though, great community. I bought 'The Rspec Book' which is what got me started looking at the to

Re: [rspec-users] Reuse of Cucumber Features

2009-04-09 Thread Williams, Wesley
Matt, I am open to referring to separate documentation/scenario. It would be nice if I can optionally make it appear in the tests but that is a nice to have. Is this just an example/idea or is it possible to do this currently? Thanks, Wes From: rspec-users-boun...@rubyforge.org [m

Re: [rspec-users] Reuse of Cucumber Features

2009-04-09 Thread Rick DeNatale
On Thu, Apr 9, 2009 at 3:57 AM, Matt Wynne wrote: > > > Another way to remove duplication (and noise) from Cucumber steps is the > hide the details in the Ruby code that implements the step, and write a much > more general step in the feature file like this: > >Given there are 3 flights de

Re: [rspec-users] Reuse of Cucumber Features

2009-04-09 Thread Matthew Krom
Two other brainstorms: Brainstorm 1: Given an empty flights database And aircraft XX1 flight number XX0001 departs on 03Mar2009 at 1000 And aircraft XX1 flight number XX0002 departs on 03Mar2009 at 1400 And aircraft XX1 flight number XX0003 departs on 03Mar2009 at 2100

[rspec-users] [Cucumber] Bug?

2009-04-09 Thread Fedor Fomenko
Hello, I have the following step for checking that a validation message is displayed on screen: Then /^(.+) should be displayed$/ do |error| msg = @browser.ul(:class, 'validation-summary-errors').li(:text, error) #pp msg.text msg.should_not == nil end I run scenario with examples table whi

Re: [rspec-users] [Rspec] Trying to get rspec to test a controller in a namespace

2009-04-09 Thread Matt Wynne
Beware of scaffolds - they stop you from thinking which is never good. Anyway my guess at the answer is inline. On 8 Apr 2009, at 22:18, TimBooher wrote: any takers? am i asking a question that is too hard or too easy and boring? thanks, tim On Apr 7, 7:41 am, Tim Booher wrote: I am trying

Re: [rspec-users] Reuse of Cucumber Features

2009-04-09 Thread Matt Wynne
On 8 Apr 2009, at 10:31, Williams, Wesley wrote: All, I know this is an older post but I have a similar but different set of scenarios I need to handle. I have a set of flight related scheduling features, such as delay, reschedule, and cancel, each with multiple scenarios that have an ef

Re: [rspec-users] Pending expectations

2009-04-09 Thread Sven
> No, please don't get used to it. The behaviour you expect is correct, > and the behaviour you are seeing is incorrect. Okidoke, I've submitted a ticket on Lighthouse. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/