Re: [rspec-users] polymorphic controller testing

2009-08-26 Thread john
hi rick,thanks for responsding. You're right, I realized that all i had to do was stub a method inside that controller and just call SchedulesController from the spec. On Wed, Aug 26, 2009 at 3:54 PM, john wrote: > I was hoping that I could set the controller name as "MeetingsController" > whic

Re: [rspec-users] polymorphic controller testing

2009-08-26 Thread john
I was hoping that I could set the controller name as "MeetingsController" which would be a polymorphic type of the Schedules controller? On Wed, Aug 26, 2009 at 3:48 PM, Rick DeNatale wrote: > On Wed, Aug 26, 2009 at 2:39 PM, john wrote: > > Hi Rspec Community, > > I ran into an interesting probl

Re: [rspec-users] polymorphic controller testing

2009-08-26 Thread Rick DeNatale
On Wed, Aug 26, 2009 at 2:39 PM, john wrote: > Hi Rspec Community, > I ran into an interesting problem yesterday. > I'm using polymorphic_path for my controller, but I can't figure out how to > test it. > > # routes.rb > map.resources :schedules > ma

[rspec-users] Fwd: polymorphic controller testing

2009-08-26 Thread john
I'm totally stumped. Still researching, but to no avail Hi Rspec Community, I ran into an interesting problem yesterday. I'm using polymorphic_path for my controller, but I can't figure out how to test it. # routes.rb map.resources :schedules ma

Re: [rspec-users] running a fast subset of the specs

2009-08-26 Thread Alex Chaffee
Sure. Put all your fast specs in a subdirectory spec/fast. Then Spec::Rake::SpecTask.new do |t| t.spec_files = FileList['spec/fast/**/*_spec.rb'] end or something to that effect. Alternately, put your slow specs in a subdirectory, but I think the above way is arguably cleaner. --- Alex

[rspec-users] running a fast subset of the specs

2009-08-26 Thread morgflast
My rails project has a lot of specs. Most of these run quickly. There are a handful of files, like spec/model/slow_spec1.rb and spec/model/slow_spec2.rb that run slowly because they have to do various slow operations like using a timer. I would like to write a rake task, like rake:spec:fast,

[rspec-users] [Q] testing WIN32OLE_EVENT callbacks

2009-08-26 Thread Chuck Remes
I'm trying to setup some specs (really just assertions) that verify some callbacks are executed in response to COM events. In the WIN32OLE_EVENT class you may subscribe to a COM event and have it delivered to you for processing. Syntax looks like: event_handler.on_event('Start

[rspec-users] polymorphic controller testing

2009-08-26 Thread john
Hi Rspec Community, I ran into an interesting problem yesterday. I'm using polymorphic_path for my controller, but I can't figure out how to test it. # routes.rb map.resources :schedules map.resources :meetings, :controller => 'schedules' # meetings

Re: [rspec-users] How do I get spec to look for _spec.rb files in multiple levels of subdirs?

2009-08-26 Thread Masha
That was it, thank you! On Aug 26, 3:10 am, David Chelimsky wrote: > On Wed, Aug 26, 2009 at 12:38 AM, Masha wrote: > > Hi, > > > I have the following in my rspec.rake file, yet it doesn't treat ** as > > it should - iterating through all subdirectories of spec/qa, but > > instead it only finds r

Re: [rspec-users] arbitrary handling of received messages in mocks

2009-08-26 Thread Chuck Remes
On Aug 25, 2009, at 5:13 PM, Tom Stuart wrote: On 25 Aug 2009, at 20:59, Chuck Remes wrote: The documentation says the expectation passes or fails based upon the return value of the block. I can't even force it to fail by returning false. The docs (http://rspec.info/documentation/mocks/me

Re: [rspec-users] undefined method `and_return'

2009-08-26 Thread Oliver Barnes
sure thing: http://pastie.org/595363 2009/8/26 David Chelimsky : > On Tue, Aug 25, 2009 at 6:19 PM, Oliver > Barnes wrote: >> Hello, >> >> I'm struggling with this controller spec for a few hours now >> >> http://pastie.org/594775 >> >> which is failing with an error I can't find any references a

Re: [rspec-users] metaprogrammatically generating spec examples

2009-08-26 Thread Joaquin Rivera Padron
hey guys, now I got it! the thing I was not seeing was the instance.should validate_... validation evaluation, I end up doing this: - create the object with desired state, - then iterating over all its attributes and -- validating required ones -- and not_validating not required ones. The key is

Re: [rspec-users] How do I get spec to look for _spec.rb files in multiple levels of subdirs?

2009-08-26 Thread David Chelimsky
On Wed, Aug 26, 2009 at 12:38 AM, Masha wrote: > Hi, > > I have the following in my rspec.rake file, yet it doesn't treat ** as > it should - iterating through all subdirectories of spec/qa, but > instead it only finds relevant files that are one level down. > > script/runner ./vendor/gems/rspec-1.

Re: [rspec-users] undefined method `and_return'

2009-08-26 Thread David Chelimsky
On Tue, Aug 25, 2009 at 6:19 PM, Oliver Barnes wrote: > Hello, > > I'm struggling with this controller spec for a few hours now > > http://pastie.org/594775 > > which is failing with an error I can't find any references about, > neither on the list nor on the web in general: > > Admin::ImagesContro

[rspec-users] How do I get spec to look for _spec.rb files in multiple levels of subdirs?

2009-08-26 Thread Masha
Hi, I have the following in my rspec.rake file, yet it doesn't treat ** as it should - iterating through all subdirectories of spec/qa, but instead it only finds relevant files that are one level down. script/runner ./vendor/gems/rspec-1.2.8/bin/spec --options "./spec/qa/ spec.opts" ./spec/qa/**/

Re: [rspec-users] metaprogrammatically generating spec examples

2009-08-26 Thread Tom Stuart
On 25 Aug 2009, at 23:39, Joaquin Rivera Padron wrote: where you iterate over an array of known required attributes and then generate the typical %{it 'should require required attribute'} spec example. That's easy with shoulda, but in this case the validations are contextual, they have the :