I've got a functional test that errors on the following method, saying that the first "Quality.create!(..." statement has too many arguments, which doesn't make any sense to me at all.
Running Ruby 1.8, Rails 2.3.5
def reset_quality_lut
Quality.delete_all
Quality.create!(:value => 1, :name => "Scrap", :extended_name => " (only good for parts)" )
Quality.create!(:value => 2, :name => "Heavy use", :extended_name => " (needs work)" )
Quality.create!(:value => 3, :name => "Medium use", :extended_name => " (some functional damage)")
Quality.create!(:value => 4, :name => "Light use", :extended_name => " (cosmetic damage only)" )
Quality.create!(:value => 5, :name => "New", :extended_name => " (or like new)" )
Quality.create!(:value => 0, :name => "Any", :extended_name => "/all" )
end
What the method is supposed to do is delete, and then re-create all the values in this table.
Here is the requested stack trace (note that I get the same thing if I replace the '.create' with a '.new(....).save':
1) Error:
test_should_create_an_admin_user_on_app_setup(SetupControllerTest):
ArgumentError: wrong number of arguments (1 for 0)
app/controllers/setup_controller.rb:43:in `reset_quality_lut'
app/controllers/setup_controller.rb:23:in `create'
/test/functional/setup_controller_test.rb:78:in `test_should_create_an_admin_user'
In the app, what this controller does is let you setup the app after initial setup. So...
www.myapp.com/setup/new
Brings you to a page where you enter a username and password for the first admin. When this succeeds, this action becomes inaccessible, so long as there's 1 admin user in the database.
EDIT: If I try "Quality.new.save", I get a nil error. Seems my "new" method is returning nil for some strange reason.