#rubyonrails - Sun 4 Mar 2007 between 11:27 and 11:38

NY Lost Funds



djwonkchapel: right, that recreates the schema but not the contents
docukjstew, the whole point of this anyways was so i could do something like validates_length_of :password, :within => 5..40
chapelif thats the case you either need to use fixtures, or dump the database and load it in the test one
djwonkchapel: how can I use fixtures that stick around (persist) for all test cases?
Kriyasurferdjwonk: Do you have the Rails book? I recall a section in there about code you can run before every single test. You can load a fixture that way.
djwonkKriyasurfer: I do have AWDwR v2, I'll look again...
Kriyasurferdjwonk: you're other option is to add the "unpaid" "basic" or "premium" INSERT commands into the migration itself
djwonkKriyasurfer: that is exactly what I have done :)
Kriyasurfer: but these records only populate into development database, not the test database
KriyasurferKriyasurfer: so ... INSERTs don't work for the test database?
djwonk: that's right! tests uses schema dump
djwonkKriyasurfer: I don't think migrations actually RUN against the test database. I think Rails just clones the schema from development.
jstewdocuk: and you should be able to do that.
docukjstew, oh this is interesting - let me paste, 2 sec
jstewdocuk: here's some working code http://pastie.caboo.se/44599
as an example
djwonkKriyasurfer: i could use the setup method in all my methods, to load the Listings fixture each time. But that seems like a lot of overhead
docukjstew, http://pastie.caboo.se/44601
djwonkKriyasurfer: maybe I can find (or write) a rake task that dumps development database into test database
Kriyasurferdjsmacedo: if you declare fixture in each of your test it should be ok. And as for performance ... this is your testing rig, so unless you're doing continuous integration testing ...
chapelwhy not just use the sql to do so
but yeah, adding "fixtures :blah" will load the fixture to your test every time
jstewdocuk: if you have an attr_accessor for password, and a password= method your password= method will override the writer of the accessor. probably not what you want.
Kriyasurferdjwonk: also, there are plugins available for loading yml inside migrations
chapelKriyasurfer: what do you use for a dev platform?
ie system/software
Kriyasurferchapel: sure. Ugly ... but for me, it is being thorough when you test
chapel: My Sony VAIO laptop running Gentoo
chapelah fun
vi i guess
KriyasurferYeah. I admit. I got it for the looks rather than for how Linux-compatible it is. But dual-core 1GB wasn't anything to sneeze at.
actionchapel has a macbook and loves Textmate
chapelhas a macbook and loves Textmate
docukjstew, ok i see the problem now
jstew, attr_accessor isn't really transparent, since it uses instance variables
KriyasurferHey, if I could use TextMate on my Gentoo box, I would. I got the VAIO 'cause it is the PC laptop that looks the closest to a Mac laptop without actually being a Mac
chapelhaha yeah
what are the system specs?
you could run osx86
lol
Kriyasurferchapel: 1.6ghz dual core 1GB. It's OK. I usually have Linux run the cores at 800mhz most of the time though.

Page: 2 9 16 23 30 37 44 51 58 65 72 79 86 93 100 107 

IrcArchive

NY Lost Funds