Hello dear Railers ! I''ve got a little problem loading fixtures. In my login_controller_test.rb, I''ve added this line : fixtures :users I''ve got a file users.yml in my fixtures directory. When I try to load my functionnal test, I''ve got this error : nico@bounga:depot $ ruby test/functional/login_controller_test.rb test/functional/login_controller_test.rb:4: undefined method `fixtures'' for #<Object:0x402c0970> (NoMethodError) I don''t understand why ... I''m using rails 0.13.1. Hope you can help me. Bye. -- Nicolas Cavigneaux | GPG KeyID : CFE76D24 nico-DRabjd/C3MEdnm+yROfE0A@public.gmane.org | http://www.bounga.org _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
The ''fixtures'' line is after the class line right? like so: class UserControllerTest < Test::Unit::TestCase fixtures :users On 9/9/05, Nicolas Cavigneaux <nico-DRabjd/C3MEdnm+yROfE0A@public.gmane.org> wrote:> Hello dear Railers ! > > I''ve got a little problem loading fixtures. In my > login_controller_test.rb, I''ve added this line : > > fixtures :users > > I''ve got a file users.yml in my fixtures directory. > > When I try to load my functionnal test, I''ve got this error : > > nico@bounga:depot $ ruby test/functional/login_controller_test.rb > test/functional/login_controller_test.rb:4: undefined method `fixtures'' > for #<Object:0x402c0970> (NoMethodError) > > I don''t understand why ... I''m using rails 0.13.1. > > Hope you can help me. > > Bye. > -- > Nicolas Cavigneaux | GPG KeyID : CFE76D24 > nico-DRabjd/C3MEdnm+yROfE0A@public.gmane.org | http://www.bounga.org > > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.1 (GNU/Linux) > > iD8DBQBDIdm1csG2ks/nbSQRAjyDAJ4iY+cSg1N5IB4dkBxbdGm13oscJwCgq7LA > fYVU5MS+9z8NAJS4kwWKx7k> =cg9U > -----END PGP SIGNATURE----- > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- Chad Nantais cnantais-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Can you post the complete login_controller_test.rb file? (i''m guessing you the fixtures call in the wrong place) On 9/9/05, Nicolas Cavigneaux <nico-DRabjd/C3MEdnm+yROfE0A@public.gmane.org> wrote:> Hello dear Railers ! > > I''ve got a little problem loading fixtures. In my > login_controller_test.rb, I''ve added this line : > > fixtures :users > > I''ve got a file users.yml in my fixtures directory. > > When I try to load my functionnal test, I''ve got this error : > > nico@bounga:depot $ ruby test/functional/login_controller_test.rb > test/functional/login_controller_test.rb:4: undefined method `fixtures'' > for #<Object:0x402c0970> (NoMethodError) > > I don''t understand why ... I''m using rails 0.13.1. > > Hope you can help me. > > Bye. > -- > Nicolas Cavigneaux | GPG KeyID : CFE76D24 > nico-DRabjd/C3MEdnm+yROfE0A@public.gmane.org | http://www.bounga.org > > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.1 (GNU/Linux) > > iD8DBQBDIdm1csG2ks/nbSQRAjyDAJ4iY+cSg1N5IB4dkBxbdGm13oscJwCgq7LA > fYVU5MS+9z8NAJS4kwWKx7k> =cg9U > -----END PGP SIGNATURE----- > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >
Le vendredi 09 septembre 2005 à 15:40 -0400, Chad Nantais a écrit :> The ''fixtures'' line is after the class line right? > > like so: > > class UserControllerTest < Test::Unit::TestCase > fixtures :usersThat was the mistake :-/ It was in my setup method ... Now it works well, thank you ! Bye. -- Nicolas Cavigneaux | GPG KeyID : CFE76D24 nico-DRabjd/C3MEdnm+yROfE0A@public.gmane.org | http://www.bounga.org _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On 9/9/05, Nicolas Cavigneaux <nico-DRabjd/C3MEdnm+yROfE0A@public.gmane.org> wrote:> Le vendredi 09 septembre 2005 à 15:40 -0400, Chad Nantais a écrit : > > The ''fixtures'' line is after the class line right? > > > > like so: > > > > class UserControllerTest < Test::Unit::TestCase > > fixtures :users > > That was the mistake :-/ > > It was in my setup method ... > > Now it works well, thank you ! > > Bye.Great! Just some advice, it''s important to understand why the fixtures line can''t be inside the setup method (or any other method).