[rspec-users] Possible improvements to routing spec API

2010-07-05 Thread Wincent Colaiuta
Hi folks, I've been unhappy with routing specs for a long time now and last night when updating some old 1.3 specs for 2.0 I decided to see if I could come up with something that didn't make me feel unhappy. Principal causes of unhappiness: 1. Historically we had "route_for" and "params_from",

Re: [rspec-users] Possible improvements to routing spec API

2010-07-05 Thread Matt Wynne
On 5 Jul 2010, at 08:00, Wincent Colaiuta wrote: > Hi folks, > > I've been unhappy with routing specs for a long time now and last night when > updating some old 1.3 specs for 2.0 I decided to see if I could come up with > something that didn't make me feel unhappy. > > Principal causes of un

Re: [rspec-users] Possible improvements to routing spec API

2010-07-05 Thread David Chelimsky
On Jul 5, 2010, at 4:14 AM, Matt Wynne wrote: > On 5 Jul 2010, at 08:00, Wincent Colaiuta wrote: >> Hi folks, >> >> I've been unhappy with routing specs for a long time now and last night when >> updating some old 1.3 specs for 2.0 I decided to see if I could come up with >> something that didn'

Re: [rspec-users] spec'ing namespaced routes

2010-07-05 Thread David Chelimsky
On Jul 4, 2010, at 7:15 PM, Frank Mattia wrote: > What's the appropriate way to test namespaced routes with rspec-2 & > rails 3? > > I imagined that the following would work but it does not. > > describe Admin::UsersController do > describe "routing" do >it "recognizes and generates #index"

Re: [rspec-users] Help with nested routes test in Rails 3

2010-07-05 Thread David Chelimsky
On Jul 4, 2010, at 3:28 PM, Lalish-Menagh, Trevor wrote: > > On Sat, Jul 3, 2010 at 2:40 AM, Lalish-Menagh, Trevor > wrote: >> Hi all, >> >> I must be doing something wrong here. Could someone point me in the >> right direction? I am trying to test my nested resources in Rails 3. >> >> The rout

Re: [rspec-users] Possible improvements to routing spec API

2010-07-05 Thread Wincent Colaiuta
El 05/07/2010, a las 13:56, David Chelimsky escribió: > Nice overall. Much of the code belongs in Rails, though, so I'd like to try > to get a patch in to Rails once we get this worked out. I'd like the > rspec-rails matchers to be simple wrappers for rails' assertions wherever > possible. We

[rspec-users] Problem specing application layout, missing partial?

2010-07-05 Thread Pixel
In an effort to teach myself BDD I'm trying it out. I'm trying to do a simple (should be straightforward) spec on my application.html.haml file first looking for a div tag with the class 'nav' it seems that rspec isn't able to render the app/views/layouts/application.html.haml file. Gist with com

Re: [rspec-users] Problem specing application layout, missing partial?

2010-07-05 Thread David Chelimsky
On Jul 5, 2010, at 9:52 AM, Pixel wrote: > In an effort to teach myself BDD I'm trying it out. I'm trying to do a > simple (should be straightforward) spec on my application.html.haml file > first looking for a div tag with the class 'nav' it seems that rspec isn't > able to render the app/vi

Re: [rspec-users] Possible improvements to routing spec API

2010-07-05 Thread David Chelimsky
On Jul 5, 2010, at 9:04 AM, Wincent Colaiuta wrote: > El 05/07/2010, a las 13:56, David Chelimsky escribió: > >> Nice overall. Much of the code belongs in Rails, though, so I'd like to try >> to get a patch in to Rails once we get this worked out. I'd like the >> rspec-rails matchers to be simp

Re: [rspec-users] Possible improvements to routing spec API

2010-07-05 Thread Wincent Colaiuta
El 05/07/2010, a las 18:18, David Chelimsky escribió: > The thing that concerns me the most is the DestinationParser. Even though it > seems simple, that's the sort of code that ends up making rspec-rails a > rails-dependent maintenance problem. But seeing as we're wrapping Rails assertions we'

Re: [rspec-users] Possible improvements to routing spec API

2010-07-05 Thread David Chelimsky
On Jul 5, 2010, at 11:58 AM, Wincent Colaiuta wrote: > El 05/07/2010, a las 18:18, David Chelimsky escribió: > >> The thing that concerns me the most is the DestinationParser. Even though it >> seems simple, that's the sort of code that ends up making rspec-rails a >> rails-dependent maintenan

Re: [rspec-users] Problem specing application layout, missing partial?

2010-07-05 Thread Pixel
On Mon, Jul 5, 2010 at 11:16 AM, David Chelimsky wrote: > On Jul 5, 2010, at 9:52 AM, Pixel wrote: > > In an effort to teach myself BDD I'm trying it out. I'm trying to do a > simple (should be straightforward) spec on my application.html.haml file > first looking for a div tag with the class 'na

Re: [rspec-users] Loading problem with engine extending ActionController::Base

2010-07-05 Thread David Chelimsky
On Jul 3, 2010, at 4:40 PM, Michael Schuerig wrote: > On Saturday 03 July 2010, David Chelimsky wrote: >> On Jul 3, 2010, at 3:34 PM, Michael Schuerig wrote: > > [double loading of Rails framework classes] >>> require File.dirname(__FILE__) + "/../config/environment" unless >>> defined?(Rails) >>

Re: [rspec-users] Problem specing application layout, missing partial?

2010-07-05 Thread David Chelimsky
On Jul 5, 2010, at 12:21 PM, Pixel wrote: > On Mon, Jul 5, 2010 at 11:16 AM, David Chelimsky wrote: > On Jul 5, 2010, at 9:52 AM, Pixel wrote: > >> In an effort to teach myself BDD I'm trying it out. I'm trying to do a >> simple (should be straightforward) spec on my application.html.haml file

Re: [rspec-users] Possible improvements to routing spec API

2010-07-05 Thread Wincent Colaiuta
El 05/07/2010, a las 18:58, Wincent Colaiuta escribió: > El 05/07/2010, a las 18:18, David Chelimsky escribió: > >> Slight tangent - one nice thing about 'recognize' as a matcher name is we >> get this for free: >> >> it { should_not recognize(:get => '/wiki/foo') } > > True, but with "get()"

Re: [rspec-users] Possible improvements to routing spec API

2010-07-05 Thread Wincent Colaiuta
El 05/07/2010, a las 19:17, David Chelimsky escribió: > On Jul 5, 2010, at 11:58 AM, Wincent Colaiuta wrote: > >> El 05/07/2010, a las 18:18, David Chelimsky escribió: >> >>> The thing that concerns me the most is the DestinationParser. Even though >>> it seems simple, that's the sort of code t

[rspec-users] [ANN] ShRUG 8, Mon July 12th: Introduction to RSpec

2010-07-05 Thread Ashley Moran
Hi all Reposting this for the benefit of anyone who may be able to attend but wouldn't normally see ShRUG announcements. ShRUG is the Sheffield (UK) Ruby User Group. ShRUG July 2010 is now confirmed. Ashley Moran (that's me) of PatchSpace Ltd (that's also me, really) will be running an intro

Re: [rspec-users] Possible improvements to routing spec API

2010-07-05 Thread David Chelimsky
On Jul 5, 2010, at 12:38 PM, Wincent Colaiuta wrote: > El 05/07/2010, a las 19:17, David Chelimsky escribió: > >> On Jul 5, 2010, at 11:58 AM, Wincent Colaiuta wrote: >> >>> El 05/07/2010, a las 18:18, David Chelimsky escribió: >>> The thing that concerns me the most is the DestinationPars

Re: [rspec-users] Possible improvements to routing spec API

2010-07-05 Thread Randy Harmon
I'll chime in, having contributed some of the mess at hand. Good things I'm seeing between current route helpers and proposals include: * The router being at the center of what's being tested * Similarity of specs to other conventions * Ability to specify bi-directional routing behavior (by defa

Re: [rspec-users] Possible improvements to routing spec API

2010-07-05 Thread Randy Harmon
On 7/5/10 2:14 AM, Matt Wynne wrote: > Seems like progress. One thought: Why not use a macro-style syntax to > eliminate the boring boilerplate call to #it / #example and generate examples > instead? I thought this was an insightful comment. Riffing on that, I get what clearly becomes a DSL alon

Re: [rspec-users] Possible improvements to routing spec API

2010-07-05 Thread Randy Harmon
David Chelimsky wrote: > ps - I moved your post to the bottom - please bottom/inline post > instead of top-posting (http://idallen.com/topposting.html). Sorry, perhaps I should have deleted most of the quotey bits, since I was replying very generally to the thread. > Check out these two threads: >

Re: [rspec-users] Possible improvements to routing spec API

2010-07-05 Thread Wincent Colaiuta
El 05/07/2010, a las 21:00, Randy Harmon escribió: > David Chelimsky wrote: >> Check out these two threads: >> >> http://groups.google.com/group/rspec/browse_thread/thread/9ac4ff6f3bac8423 >> http://groups.google.com/group/rspec/browse_thread/thread/4775eaa9b8b3c25f >> >> Both of them were, coin

Re: [rspec-users] Possible improvements to routing spec API

2010-07-05 Thread Lalish-Menagh, Trevor
OK, I will chime in here, since I think I might have opened up this can of worms. :) I agree with David that we should stick with wrapping the Rails public APIs. That is: assert_generates, assert_recognizes, and assert_routing (http://edgeapi.rubyonrails.org/classes/ActionDispatch/Assertions/Routi

Re: [rspec-users] Possible improvements to routing spec API

2010-07-05 Thread Wincent Colaiuta
El 05/07/2010, a las 20:18, Randy Harmon escribió: > I'm uncertain about the need to easily specify one-directional routes. > While in theory it sounds fine, I don't understand why you'd want to > specify either a route that isn't recognized (why bother routing it, in > this case?) or one that do

Re: [rspec-users] Loading problem with engine extending ActionController::Base

2010-07-05 Thread Michael Schuerig
On Monday 05 July 2010, David Chelimsky wrote: > On Jul 3, 2010, at 4:40 PM, Michael Schuerig wrote: > > On Saturday 03 July 2010, David Chelimsky wrote: > >> On Jul 3, 2010, at 3:34 PM, Michael Schuerig wrote: > > [double loading of Rails framework classes] > > > >>> require File.dirname(__FILE__

Re: [rspec-users] [Rails] Stubbed static methods are bleeding over into other specs and making them fail

2010-07-05 Thread David Chelimsky
On Jul 2, 2010, at 7:25 PM, Patrick Gannon wrote: > Hi all, > > I'm having a problem where stubbed static methods aren't properly becoming > "unstubbed". I have tried manually unstubbing them, but it still doesn't > work. > > Spec is as follows: > > it "creates user accounts for unknown

Re: [rspec-users] rspec 2 not cleaning up after examples run?

2010-07-05 Thread Timo Rößner
Hey David, sorry for the late reply, you nailed it, that was the problem indeed..:-) Thanks a lot for the assist. Cheers On Jul 1, 2:15 pm, David Chelimsky wrote: > On Jul 1, 2010, at 3:22 AM, Timo Rößner wrote: > > > > > On Jun 30, 7:44 pm, Amiruddin Nagri wrote: > >> I am not sure if this w