Functional test code generated by scaffold_resource fails with custom inflections while the user interface behaves as expected.
Here are the steps to reproduce this error:
rails rest_test
cd rest_test
rake rails:freeze:edge TAG=rel_1-2-0_RC1
Edit config/environment.rb and add a custom inflection:
Inflector.inflections do |inflect|
inflect.irregular "goose", "geese"
end
Generate the REST interface:
script/generate scaffold_resource Goose title:string
Create databases:
mysqladmin -uroot create rest_test_development
mysqladmin -uroot create rest_test_test
Run generated migration:
rake db:migrate
Kick off the tests:
rake test
I get errors like:
7 tests, 4 assertions, 0 failures, 5 errors
NoMethodError: undefined method `goose_path' for #<GeeseController:0xb71e2a88>
ActionView::TemplateError: undefined method `goose_path' for #<#<Class:0xb73e6a58>:0xb710fb94>
ActionView::TemplateError: undefined method `goose_path' for #<#<Class:0xb73e6a58>:0xb70a0adc>
ActionView::TemplateError: undefined method `edit_goose_path' for #<#<Class:0xb73e6a58>:0xb6f4b628>
NoMethodError: undefined method `goose_path' for #<GeeseController:0xb6e39488>
If I start the server:
script/server
I can create, show, update, and destroy Geese by hand. I also do not encounter this problem with built in inflections like Person and People.
I get the same results on Edge Rails (revision 5714) as well.