Works in script but not in rake

Hi,

This is weird

All my current spec examples are passing (about 750 of 'em) except a
set of 6 in a specific controller spec. I get the following failure
on each 6 when I run it via
$ rake spec
for example:

ActionController::UnknownAction in ‘MembershipsController handling
PUT /project/ID/membership/N/accept should flash message’
No action responded to accept

but if I run the spec file individually, all the examples pass with
no failures
$ script/spec --color --format specdoc spec/controllers/
memberships_controller_spec.rb

My routes.rb contains

map.resources :projects do |project|
project.resources :memberships, :member => { :accept => :get }

end

but I have other resources with :member actions defined and they spec ok

This is completely repeatable.

Any ideas?

I’m running with an older version of rails edge (7310)
and the latest trunk rspec and rspec_on_rails (updated this evening)

linoj

btw I just noticed the text of the example is a typo, it -is- a GET
called in the spec with

 get :accept, :project_id => @project.id, :id => @mem.id

On 10/17/07, Jonathan L. [email protected] wrote:

Hi,

This is weird

All my current spec examples are passing (about 750 of 'em) except a
set of 6 in a specific controller spec. I get the following failure
on each 6 when I run it via
$ rake spec

Do you have --reverse in your spec/spec.opts file? If so, the specs
are being run in reverse order w/ rake, but not when you just run the
file directly. This usually indicates that there is an undesirable
dependency between examples in your specs.

On Oct 17, 2007, at 1:26 AM, David C. wrote:

Do you have --reverse in your spec/spec.opts file? If so, the specs
are being run in reverse order w/ rake, but not when you just run the
file directly. This usually indicates that there is an undesirable
dependency between examples in your specs.


rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

I renamed that particular action (“accept”) and the error goes away,
so apparently I had some namespace conflict in the controller

Hi,

I’ve came across it also and finally figured out the following:
http://www.taknado.com/2007/10/30/poking-in-actioncontroller

Thanks