Forum: Ruby on Rails how to use many fixtures for one table?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
158fd6a8f789a94711891e8338592f6e?d=identicon&s=25 Yan Rong (yananay)
on 2007-05-29 04:50
hi all,
now i have a problem when do the functinal testing.
assume i have a table named "customers".

when i run the first test case, i need 20 records in the "customers"
table.
when i run the second test case, i need 200 records in the "customers"
table.

so, if i only use one "customers.yml" fixtures, the first test case
will cost much time.

then how to use many fixtures for one table?

appriciated for your help, thanks!
588ab1c0a5610a7e160a3b101abb91e6?d=identicon&s=25 MichaelLatta (Guest)
on 2007-05-29 06:06
(Received via mailing list)
I am not all that happy with fixtures as they are at the DB level and
not the model level.  You need to get IDs right between files etc.

Have you tried just creating a different YML file in the fixtures
directory, then splitting your tests into separate classes that
reference the different fixtures?

I do not know if this will work, but I would expect it to.

Michael
4a79f6a97e31b1d13b239e7f52187674?d=identicon&s=25 Joon You (joonee)
on 2007-05-29 17:46
(Received via mailing list)
rake db:fixtures:load [FIXTURES=x,y,z]


On May 28, 10:50 pm, Yan Rong <rails-mailing-l...@andreas-s.net>
158fd6a8f789a94711891e8338592f6e?d=identicon&s=25 Yan Rong (yananay)
on 2007-05-31 06:55
Joon You wrote:
> rake db:fixtures:load [FIXTURES=x,y,z]
>
>
> On May 28, 10:50 pm, Yan Rong <rails-mailing-l...@andreas-s.net>

i think i cannt use "rake" command in my test class?
This topic is locked and can not be replied to.