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 Oct 17, 2007, at 1:01 AM, Jonathan Linowes 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 > 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 > > > > > > >
On 10/17/07, Jonathan Linowes <jonathan at parkerhill.com> 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 specDo 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 Chelimsky wrote:> On 10/17/07, Jonathan Linowes <jonathan at parkerhill.com> 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. > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-usersI renamed that particular action ("accept") and the error goes away, so apparently I had some namespace conflict in the controller