hello all, i have a problem with test_truth. require ''test_helper'' class MyDataTest < ActiveSupport::TestCase def test_truth assert true end end this should ok without failures or errors. but it failure: 1) Error: test_truth(MyDataTest): ActiveRecord::StatementInvalid: Mysql::Error: Table ''alldataserver_test.members'' doesn''t exist: DELETE FROM `members` whats here wrong? i understand table members is not exist in alldataserver_test, but why? here is a mistake with migration i think, can someone help me? lg -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 21 Feb 2009, at 20:51, Hello Guy wrote:> > hello all, > > i have a problem with test_truth. > > > require ''test_helper'' > > class MyDataTest < ActiveSupport::TestCase > def test_truth > assert true > end > > end > > this should ok without failures or errors. but it failure: > > 1) Error: > test_truth(MyDataTest): > ActiveRecord::StatementInvalid: Mysql::Error: Table > ''alldataserver_test.members'' doesn''t exist: DELETE FROM `members` > > whats here wrong? > i understand table members is not exist in alldataserver_test, but > why? > here is a mistake with migration i think, can someone help me? >it means that there is a fixtures file called members.yml so rails helpfully tries to load it into your test database but there is no such table. Fred> > lg > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:> On 21 Feb 2009, at 20:51, Hello Guy wrote: > >> assert true >> >> whats here wrong? >> i understand table members is not exist in alldataserver_test, but >> why? >> here is a mistake with migration i think, can someone help me? >> > it means that there is a fixtures file called members.yml so rails > helpfully tries to load it into your test database but there is no > such table. > > Fredthanks, i know, in test database are not tables. my question is: why are not the tables for test database create? i did database migration and it creates only tables for development database but not for my test database. where can be the problem? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hello Guy wrote:> thanks, i know, in test database are not tables. my question is: why are > not > the tables for test database create? > i did database migration and it creates only tables for development > database but > not for my test database. where can be the problem?I find the rake db:migrate commands to be less than comprehensive here. Sometimes one rake command understands testing, but another one does not. In this case, I always find myself entering: rake RAILS_ENV=test db:migrate That uses rake''s ability to push its command line options with = into environmental variables. Then the migrator uses the test: version in database.yml. Also try db:reset, or db:migrate:reset. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Feb 22, 3:48 pm, Phlip <phlip2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello Guy wrote: > > thanks, i know, in test database are not tables. my question is: why are > > not > > the tables for test database create? > > i did database migration and it creates only tables for development > > database but > > not for my test database. where can be the problem? > > I find the rake db:migrate commands to be less than comprehensive here. > Sometimes one rake command understands testing, but another one does not. >If you run rake to run your unit tests, that should clone the structure from the development database to the test one. Fred> In this case, I always find myself entering: > > rake RAILS_ENV=test db:migrate > > That uses rake''s ability to push its command line options with = into > environmental variables. Then the migrator uses the test: version in database.yml. > > Also try db:reset, or db:migrate:reset.--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:> On Feb 22, 3:48�pm, Phlip <phlip2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> > If you run > > rake > > to run your unit tests, that should clone the structure from the > development database to the test one. > > FredHello Philip and Fred, i use netbeans6.5 and i don''t know how i can enter rake RAILS_ENV=test db:migrate but i try db:migrate:reset and it reset tables on development but in test are nothing with tables :((( i do the whole time run "rake", but the effect is what i tell :((( i will tell you, this problem appearance when i checkout the project from svn repository, perhaps this is a good information for you to help me. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hello, ok it works :)))))) there are tables in my test database :)))) there are the right tables :))))) i think .... :(( if i run the unit test def test_truth assert true end there is one error: 1) Error: test_truth(MyDataTest): ActiveRecord::StatementInvalid: Mysql::Error: Unknown column ''mydata'' in ''field list'': INSERT INTO `members` (`person_id`, `created_at`, `updated_at`, `mydata`, `id`, `mydata_id`) VALUES (1, ''2009-02-22 18:00:49'', ''2009-02-22 18:00:49'', ''verein1'', 238752903, 4) where does this column come from? i look at my database and there is no column witch call ''mydata''. also it is not in schema.rb hmpf :((( -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:> >> I find the rake db:migrate commands to be less than comprehensive here. >> Sometimes one rake command understands testing, but another one does not.> If you run > > rake > > to run your unit tests, that should clone the structure from the > development database to the test one.Maybe we do the trick too often where we add a migration, then run the one test waiting for it. That resolves to: ruby test/unit/foo_test.rb -n test_bar ...which utterly bypasses all rake scripts. But our projects are old, so their scripts might not be well tuned. Then I don''t know what the OP''s real problem is, but ''rake RAILS_ENV=test db:migrate'' is well-worth a shot! -- Phlip --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hello Guy wrote:> i use netbeans6.5 and i don''t know how i can enter rake RAILS_ENV=test > db:migrateYou cannot do Rails without learning and frequently using a command line. Either CMD.EXE or bash - pick your poison! -- Phlip --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> test_truth(MyDataTest): > ActiveRecord::StatementInvalid: Mysql::Error: Unknown column ''mydata'' in > ''field list'': INSERT INTO `members` (`person_id`, `created_at`, > `updated_at`, `mydata`, `id`, `mydata_id`) VALUES (1, ''2009-02-22 > 18:00:49'', ''2009-02-22 18:00:49'', ''verein1'', 238752903, 4) > > where does this column come from?test/fixtures/members.yml --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Phlip wrote:>> test_truth(MyDataTest): >> ActiveRecord::StatementInvalid: Mysql::Error: Unknown column ''mydata'' in >> ''field list'': INSERT INTO `members` (`person_id`, `created_at`, >> `updated_at`, `mydata`, `id`, `mydata_id`) VALUES (1, ''2009-02-22 >> 18:00:49'', ''2009-02-22 18:00:49'', ''verein1'', 238752903, 4) >> >> where does this column come from? > > test/fixtures/members.ymlTHANK YOU SOOOO MUCH!!! it works great :)))) im so happy :)))) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---