#435 √ invalid
monde

:as option in map.resources not honored in get controller specs

Reported by monde | June 12th, 2008 @ 08:20 PM | in No-Milestone-Assigned

(description from the mailing list)

I have the following resource defined in my config/routes.rb (the model name is contrived)

map.resources :foo_items, :as => :foo

that I originally generated with rspec_scaffold:

ruby script/generate rspec_scaffold foo_item

but when I use the :as attribute in resources to make the URI path be '/foo' instead of '/foo_items' the default/generated controller specs for AdAssetsController become broken e.g.

it "should be successful" do

do_get

response.should be_success

end

'FooItemsController route generation should map { :controller =>

'foo_items', :action => 'index' } to /foo_items' FAILED

expected: "/foo_items",

got: "/foo (using ==)

notes:

after looking at the source for ActionController::Integration::Session#get

vendor/rails/actionpack/lib/action_controller/integration.rb

it seems like the problem might lie there outside of rspec

Comments and changes to this ticket

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Behaviour Driven Development for Ruby.

Shared Ticket Bins

People watching this ticket