Rasmus Rasmussen
2008-Oct-17 18:46 UTC
[rspec-users] Where are those tables listed for fixtures?
I''m sorry if this is posted in wrong forum. I am new to all of this with rails and rspec. Something got messed up when I changed a table''s name from ''works'' to ''work_periods''. Now the fixture:load thing does not work. Obviously the old table is still in there in some file. Anyone have any idea on where to find that file? Where does rspec read all tables when it deletes table-entries?> >rake db:fixtures:load > >rake aborted! >Mysql::Error: #42S02Table ''db_development.works'' doesn''t exist: DELETE FROM works >-- Posted via http://www.ruby-forum.com/.
Zach Dennis
2008-Oct-17 18:57 UTC
[rspec-users] Where are those tables listed for fixtures?
Do you still have "works.yml" in your fixtures/ directory? If so you''ll need to rename that to "work_periods.yml". Zach On Fri, Oct 17, 2008 at 2:46 PM, Rasmus Rasmussen <lists at ruby-forum.com> wrote:> I''m sorry if this is posted in wrong forum. I am new to all of this with > rails and rspec. > > Something got messed up when I changed a table''s name from ''works'' to > ''work_periods''. Now the fixture:load thing does not work. Obviously the > old table is still in there in some file. > > Anyone have any idea on where to find that file? Where does rspec read > all tables when it deletes table-entries? > >> >>rake db:fixtures:load >> >>rake aborted! >>Mysql::Error: #42S02Table ''db_development.works'' doesn''t exist: DELETE FROM works >> > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-- Zach Dennis http://www.continuousthinking.com http://www.mutuallyhuman.com
Rasmus Rasmussen
2008-Oct-17 19:08 UTC
[rspec-users] Where are those tables listed for fixtures?
Zach Dennis wrote:> Do you still have "works.yml" in your fixtures/ directory? If so > you''ll need to rename that to "work_periods.yml". > > Zach > > On Fri, Oct 17, 2008 at 2:46 PM, Rasmus Rasmussen <lists at ruby-forum.com> > wrote: >>> >> http://rubyforge.org/mailman/listinfo/rspec-users >> > > > > -- > Zach Dennis > http://www.continuousthinking.com > http://www.mutuallyhuman.comNope, but I really wished it was this simple. (it probably is!) I cannot find any traces from "works" or "Work" anywhere in whole project. I found the file in rspec that prints the msg: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/fixtures.rb. Perhaps there is a clever way to redefine that class to get more tracing? -- Posted via http://www.ruby-forum.com/.
Nick Hoffman
2008-Oct-17 19:17 UTC
[rspec-users] Where are those tables listed for fixtures?
On 2008-10-17, at 14:46, Rasmus Rasmussen wrote:> I''m sorry if this is posted in wrong forum. I am new to all of this > with > rails and rspec. > > Something got messed up when I changed a table''s name from ''works'' to > ''work_periods''. Now the fixture:load thing does not work. Obviously > the > old table is still in there in some file. > > Anyone have any idea on where to find that file? Where does rspec read > all tables when it deletes table-entries? > >> >> rake db:fixtures:load >> >> rake aborted! >> Mysql::Error: #42S02Table ''db_development.works'' doesn''t exist: >> DELETE FROM works >>Hi Rasmus. Have you grepped through your application for "works", and looked for all files named "*works*"? Eg: $ grep -rni ''works'' /path/to/app/ $ find /path/to/app/ -iname ''*works*'' Hope that helps, Nick
Rasmus Rasmussen
2008-Oct-17 19:28 UTC
[rspec-users] Where are those tables listed for fixtures?
Rasmus Rasmussen wrote:> Zach Dennis wrote: >> Do you still have "works.yml" in your fixtures/ directory? If so >> you''ll need to rename that to "work_periods.yml". >> >>Zach, you are right, there is another fixture under "test". I only searched in "spec"-dir. And I am in the wrong forum :-) Guess the yaml''s are placed under test because i ran generators with "model" instead of "spec_model" this feels like a duplication. If I write rspec-tests I should not do ordinary tests, because then I need to maintain two fixtures. Right? -- Posted via http://www.ruby-forum.com/.
Stephen Eley
2008-Oct-17 19:42 UTC
[rspec-users] Where are those tables listed for fixtures?
On Fri, Oct 17, 2008 at 2:46 PM, Rasmus Rasmussen <lists at ruby-forum.com> wrote:> > Something got messed up when I changed a table''s name from ''works'' to > ''work_periods''. Now the fixture:load thing does not work. Obviously the > old table is still in there in some file.Dumb question, but did you clone or re-migrate your test database after you made this change? This trips me up all the time. I''ll do something clever with the database, run db:migrate, and totally forget that that doesn''t update the test environment, just development. Then my specs fail and I freak out. -- Have Fun, Steve Eley (sfeley at gmail.com) ESCAPE POD - The Science Fiction Podcast Magazine http://www.escapepod.org
Zach Dennis
2008-Oct-17 19:51 UTC
[rspec-users] Where are those tables listed for fixtures?
On Fri, Oct 17, 2008 at 3:42 PM, Stephen Eley <sfeley at gmail.com> wrote:> On Fri, Oct 17, 2008 at 2:46 PM, Rasmus Rasmussen <lists at ruby-forum.com> wrote: >> >> Something got messed up when I changed a table''s name from ''works'' to >> ''work_periods''. Now the fixture:load thing does not work. Obviously the >> old table is still in there in some file. > > Dumb question, but did you clone or re-migrate your test database > after you made this change? > > This trips me up all the time. I''ll do something clever with the > database, run db:migrate, and totally forget that that doesn''t update > the test environment, just development. Then my specs fail and I > freak out.I use this command line alias after I write a migration: alias tmig=''rake db:migrate && rake db:rollback && rake db:migrate && rake db:test:prepare'' It makes sure that I can migrate up and down for the migration I just wrote, and it will make sure the test database is prepared. Zach> > > -- > Have Fun, > Steve Eley (sfeley at gmail.com) > ESCAPE POD - The Science Fiction Podcast Magazine > http://www.escapepod.org > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-- Zach Dennis http://www.continuousthinking.com http://www.mutuallyhuman.com
Mark Wilden
2008-Oct-17 20:25 UTC
[rspec-users] Where are those tables listed for fixtures?
On Fri, Oct 17, 2008 at 12:51 PM, Zach Dennis <zach.dennis at gmail.com> wrote:> alias tmig=''rake db:migrate && rake db:rollback && rake db:migrate > && rake db:test:prepare'' >Sounds good. Nice to see someone paying attention to their downs as well as their ups. rake db:migrate:redo will do the rollback + the re-migration in one step, saving some time. ///ar -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20081017/7f14e330/attachment.html>
Stephen Eley
2008-Oct-17 20:56 UTC
[rspec-users] Where are those tables listed for fixtures?
On Fri, Oct 17, 2008 at 3:28 PM, Rasmus Rasmussen <lists at ruby-forum.com> wrote:> > this feels like a duplication. If I write rspec-tests I should not do > ordinary tests, because then I need to maintain two fixtures. Right?Correct. You don''t need it. But the standard Rails generator doesn''t know that you''re sneaking around on it with RSpec, so it keeps putting boxes of chocolates in your /test directory hoping you''ll pay more attention to it and never knowing why you don''t come home. It''s quite touching, really. Maybe even a little poignant. -- Have Fun, Steve Eley (sfeley at gmail.com) ESCAPE POD - The Science Fiction Podcast Magazine http://www.escapepod.org
Rasmus Rasmussen
2008-Oct-18 18:40 UTC
[rspec-users] Where are those tables listed for fixtures?
Stephen Eley wrote:> On Fri, Oct 17, 2008 at 3:28 PM, Rasmus Rasmussen <lists at ruby-forum.com> > wrote: >> >> this feels like a duplication. If I write rspec-tests I should not do >> ordinary tests, because then I need to maintain two fixtures. Right? > > Correct. You don''t need it. But the standard Rails generator doesn''t > know that you''re sneaking around on it with RSpec, so it keeps putting > boxes of chocolates in your /test directory hoping you''ll pay more > attention to it and never knowing why you don''t come home. It''s quite > touching, really. Maybe even a little poignant. > > > -- > Have Fun, > Steve Eley (sfeley at gmail.com) > ESCAPE POD - The Science Fiction Podcast Magazine > http://www.escapepod.orgThat is a very nice way of putting it. Guess I still got some pending feelings for rails. Those scripts are evil! :-) Also, they are no good when practicing TDD IMO. Again, only rookie impressions... -- Posted via http://www.ruby-forum.com/.