Hello all !
Since r4397, I have 27 errors in my functional tests. Let me recap a bit:
r4393: All tests green
r4394: 2 errors, one corrected [content_edit_url(:id => @content)
transformed to content_edit_url(:id => @content.id)]
r4395: Same error
r4397: 27 errors in all
The first error I hit upon in r4394 is this:
27) Error:
test_returns_missing_status(NotFoundAttachmentsControllerTest):
NoMethodError: You have a nil object when you didn't expect it!
The error occured while evaluating nil.keys
generated code
(D:/wwwroot/rickstonehouse.com/config/../vendor/rails/actionpack/lib/action_controller/routing.rb:129):3:in
`generate_extras'
D:/wwwroot/rickstonehouse.com/config/../vendor/rails/actionpack/lib/action_controller/routing.rb:977:in
`generate'
D:/wwwroot/rickstonehouse.com/config/../vendor/rails/actionpack/lib/action_controller/routing.rb:976:in
`generate'
D:/wwwroot/rickstonehouse.com/config/../vendor/rails/actionpack/lib/action_controller/routing.rb:938:in
`generate_extras'
D:/wwwroot/rickstonehouse.com/config/../vendor/rails/actionpack/lib/action_controller/routing.rb:934:in
`extra_keys'
D:/wwwroot/rickstonehouse.com/config/../vendor/rails/actionpack/lib/action_controller/test_process.rb:103:in
`assign_parameters'
D:/wwwroot/rickstonehouse.com/config/../vendor/rails/actionpack/lib/action_controller/test_process.rb:362:in
`process'
D:/wwwroot/rickstonehouse.com/config/../vendor/rails/actionpack/lib/action_controller/test_process.rb:340:in
`get'
./test/functional/attachments_controller_test.rb:15:in
`setup_without_fixtures'
D:/wwwroot/rickstonehouse.com/config/../vendor/rails/activerecord/lib/active_record/fixtures.rb:555:in
`setup'
The route:
ActionController::Routing::Routes.draw do |map|
map.attachment_download 'document/:attachment/:url_hash',
:controller => 'attachments', :action => 'download',
:requirements =>
{:url_hash => /\A[a-z0-9]{40}\Z/, :attachment => /\A\d+\Z/}
# Install the default route as the lowest priority.
map.connect ':controller/:action/:id'
end
The failure:
class NotFoundAttachmentsControllerTest < Test::Unit::TestCase
fixtures :attachments, :attachment_authorizations, :parties, :party_emails
def setup
@controller = AttachmentsController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
# Errors out on next line:
get :download, :attachment => 241, :url_hash => '12345'
end
def test_returns_missing_status
assert_response :missing
end
end
The other errors seem to all be "can't convert nil into String".
These are all for routes with zero arguments: <%= link_to 'links',
public_links_url %>
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/url_rewriter.rb:29:in
`<<'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/url_rewriter.rb:29:in
`rewrite_url'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/url_rewriter.rb:11:in
`rewrite'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:487:in
`url_for'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/routing.rb:841:in
`public_links_url'
(eval):2:in `public_links_url'
#{RAILS_ROOT}/app/views/admin/links/_form.rhtml:24:in
`_run_rhtml_admin_links__form'
I'm sorry Nicholas and Jamis, but the routing code is complex, and I
have zero experience with it. I know, I know, this is just the
occasion to learn more about it, except r4393 is sufficiently Edge for
me.
If you want/need access to the code base to do your own tests, just
ask off-list.
Have a nice day, and thanks for your work.
Bye !
--
François Beausoleil
http://blog.teksol.info/
_______________________________________________
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core