Hello,

I'm new in rails developing and I'm just writing my first application.
I already created some controllers and models and it works.
But now I want to write some tests for my application, but I got
problems.

I wrote one unit test for one model:

test "test_should_create_a_component" do
   assert Component.create(:project_id => 1, :category_id => 1, :text
=> 'Test')
end

When I run "rake test" I get this message:

D:/Programme/InstantRails-2.0/ruby/bin/ruby.exe -I"lib;test" "D:/
Programme/InstantRails-2.0/ruby/lib/rubygems1.8/gems/rake-0.8.7/lib/
rake/rake_test_loader.rb" "test/unit/component_test.rb"
Loaded suite D:/Programme/InstantRails-2.0/ruby/lib/ruby/gems/1.8/gems/
rake-0.8.
7/lib/rake/rake_test_loader
Started
E
Finished in 0.453 seconds.

1) Error:
test_test_should_create_a_component(ComponentTest):
ActiveRecord::StatementInvalid: Mysql::Error: Unknown column 'integer'
in 'field list': INSERT INTO `brands` (`integer`, `id`, `string`)
VALUES (NULL, 996332877, NULL)

(...after that the lines of the code trace)

There is definitely no column integer or string in the model. Why does
rails ask for this columns?
I don't know where to look for the problem...

To check wether it is an problem of my application or of my rails
environment I created another demo application with only one model and
one test and there I get another error without description, only this:

D:\Programme\InstantRails-2.0\rails_apps\home>rake test
(in D:/Programme/InstantRails-2.0/rails_apps/home)
D:/Programme/InstantRails-2.0/ruby/bin/ruby.exe -I"lib;test" "D:/
Programme/InstantRails-2.0/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/
rake/rake_test_loader.rb"
D:/Programme/InstantRails-2.0/ruby/bin/ruby.exe -I"lib;test" "D:/
Programme/InstantRails-2.0/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/
rake/rake_test_loader.rb"

Errors running test:units!

I'm confused, can you help me?
Thanks in advance :-)

bye
krani

--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to