gampolt
2007-Dec-18 04:42 UTC
Can not test if model name is Tester in rails 2 (ArgumentError: wrong number of arguments (0 for 1))
I''m using rails 2.0.1 now. Here is the step for generate the error 1. Create rails project name demo "rails demo" 2. I create model name "Tester" using command "ruby script/generate model Tester name:string description:text" 3. create database (after change username and password) "rake db:create:all" 4. migrate database, both development and test "rake db:migrate" "rake db:migrate RAILS_ENV=test" 5. unit test the tester model "ruby test/unit/tester_test.rb" Here is the error i''ve got everytime D:\web\Sites\demo>ruby test/unit/tester_test.rb Loaded suite test/unit/tester_test Started .E.... Finished in 0.234 seconds. 1) Error: testers(ActionController::TestCase): ArgumentError: wrong number of arguments (0 for 1) D:/web/Sites/demo/vendor/rails/actionpack/lib/action_controller/ test_case.rb:48:in `initialize'' D:/web/Sites/demo/vendor/rails/actionpack/lib/action_controller/ test_case.rb:48:in `new'' D:/web/Sites/demo/vendor/rails/actionpack/lib/action_controller/ test_case.rb:48:in `setup_without_fixtures'' D:/web/Sites/demo/vendor/rails/activerecord/lib/active_record/ fixtures.rb:979:in `full_setup'' D:/web/Sites/demo/vendor/rails/activerecord/lib/../../ activesupport/lib/active_support/testing/default.rb:7:in `run'' 6 tests, 1 assertions, 0 failures, 1 errors I don''t know how to fix this error (wrong number of arguments) What i''ve tried is test when using other model name. e.g. Post, Comment, User, Image, ..., etc. All of them not have this problem when test. Only model name as "Tester" And this model name is work fine in rail 1.2.6 Anyone known how to correct it plese help told me. Thank you in advance.... --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---