Forum: Ruby on Rails Routes difference with Ruby 1.8.6 and 1.8.7

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bosko I. (Guest)
on 2009-04-29 22:47
(Received via mailing list)
Recently I've found Enki, blog engine written in Rails. It is very
simple and I though I could use it, but I've faced one problem that
prevented it. Namely:

rake spec

ran from Ruby 1.8.6 and 1.8.7 gives different results. On 1.8.6 all
tests pass but on 1.8.7 four (similar) errors occur. In routes.rb file
Enki has:

admin.resources :undo_items, :member => {:undo => :post}

which gives (both in 1.8.6 and 1.8.7) following (rake routes):

new_admin_undo_item GET    /admin/undo_items/new(.:format)
{:action=>"new", :controller=>"admin/undo_items"}
edit_admin_undo_item GET    /admin/undo_items/:id/edit
(.:format)        {:action=>"edit", :controller=>"admin/undo_items"}
undo_admin_undo_item POST   /admin/undo_items/:id/undo
(.:format)        {:action=>"undo", :controller=>"admin/undo_items"}
admin_undo_item GET    /admin/undo_items/:id(.:format)
{:action=>"show", :controller=>"admin/undo_items"}

Comments controller in destroy method has part:

      format.json {
        render :json => {
          :undo_path    => undo_admin_undo_item_path(undo_item),
          :undo_message => undo_item.description,
          :comment      => @comment
        }.to_json

And above path is something that makes problems. Namely result of the
test it:

ActionController::RoutingError in 'Admin::CommentsController handling
DELETE to destroy, JSON request deletes comment'
undo_admin_undo_item_url failed to generate from
{:action=>"undo", :controller=>"admin/
undo_items", :id=>#<Spec::Mocks::Mock:0x..fdafca166
@name="undo_item">}, expected: {:controller=>"admin/
undo_items", :action=>"undo"}, diff: {:id=>#<Spec::Mocks::Mock:
0x..fdafca166 @name="undo_item">}

on Ubuntu (both 8.10 and 9.04) with ruby 1.8.7 while, on the other
hand, on Windows (Ruby 1.8.6) this test pass.

Has anyone found similar problem with routes handling in 1.8.6 and
1.8.7 (Rails 2.3.2) or can give any hint why test fails?

Regards,
Bosko
This topic is locked and can not be replied to.