I did not look carefully enough at the output, I see now that it has actually started the test and is in test_test_should_create_a_component. You should be able to see from the trace where in your application it generated the faulty sql, though sometimes you have to examine the trace carefully to find the bits that are in your code and the bits that are in Rails. This might give you a clue. If you can't work it out post the trace.
It would also be worth having a look at db/schema.rb just to check what it thinks the tables should look like. Post that also if necessary. Colin 2009/5/20 krani <[email protected]> > > Hi, > > thanks for your reply > > I don't think that there is a problem with my fixtures. I have only > one: > > one: > project_id:1 > category_id:1 > name: > text:KN Airintake Kit > created_at: > updated_at: > > regards > krani > > On 19 Mai, 22:33, Colin Law <[email protected]> wrote: > > I am not sure but could this be an error in your test fixture file? It > > could be trying to load the test database from the fixture and failing > > because the syntax of your fixture yml file is wrong. > > > > Colin > > > > 2009/5/19 krani <[email protected]> > > > > > > > > > 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 -~----------~----~----~----~------~----~------~--~---

