Hi All, I was able to match the development database and migration will when running rake db:migrate I am trying to understand the error logs generated when running rake. $ rake (in /home/user/projects/emporium) /usr/bin/ruby1.8 -I"lib:test" "/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/ lib/rake/rake_test_loader.rb" "test/unit/author_test.rb" "test/unit/ helpers/about_helper_test.rb" ./test/unit/author_test.rb:4: undefined method `fixtures'' for AuthorTest:Class (NoMethodError) from /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/ rake_test_loader.rb:5:in `load'' from /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/ rake_test_loader.rb:5 from /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/ rake_test_loader.rb:5:in `each'' from /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/ rake_test_loader.rb:5 /usr/bin/ruby1.8 -I"lib:test" "/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/ lib/rake/rake_test_loader.rb" "test/functional/ about_controller_test.rb" Loaded suite /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/ rake_test_loader Started Now I am not sure anymore if I was not able to define the fixtures or where should it be corrected. D -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Dec 21, 4:38 am, dwhitekiss <dwhitek...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi All,> Now I am not sure anymore if I was not able to define the fixtures or > where should it be corrected.What does author_test.rb look like ? (Additionally these days you might as well just stick fixtures :all in test_helper.rb rather than specifying them in individual test files) Fred> > D-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
*author_test.rb* require File.dirname(__FILE__) + ''/../test_helper'' class AuthorTest < Test::Unit::TestCase fixtures :authors def test_name author = Author.create(:first_name => ''Joel'',:last_name => ''Spolsky'') assert_equal ''Joel Spolsky'', author.name end end On Mon, Dec 21, 2009 at 8:36 AM, Frederick Cheung < frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On Dec 21, 4:38 am, dwhitekiss <dwhitek...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hi All, > > > Now I am not sure anymore if I was not able to define the fixtures or > > where should it be corrected. > > What does author_test.rb look like ? (Additionally these days you > might as well just stick fixtures :all in test_helper.rb rather than > specifying them in individual test files) > > Fred > > > > D > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Dec 21, 11:17 am, dwhitekiss <dwhitek...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> *author_test.rb* > > require File.dirname(__FILE__) + ''/../test_helper'' > class AuthorTest < Test::Unit::TestCase > fixtures :authorsPre Rails 2.3 rails used to add a bunch of methods to Test::Unit::TestCase (such as stuff to do with fixtures). Post Rails 2.3 it no longer does that. If you want your test cases to have access to rails specific stuff, your test cases should inherit from ActiveSupport::TestCase Fred> def test_name > author = Author.create(:first_name => ''Joel'',:last_name => ''Spolsky'') > assert_equal ''Joel Spolsky'', author.name > end > end > > On Mon, Dec 21, 2009 at 8:36 AM, Frederick Cheung < > > > > frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > On Dec 21, 4:38 am, dwhitekiss <dwhitek...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi All, > > > > Now I am not sure anymore if I was not able to define the fixtures or > > > where should it be corrected. > > > What does author_test.rb look like ? (Additionally these days you > > might as well just stick fixtures :all in test_helper.rb rather than > > specifying them in individual test files) > > > Fred > > > > D > > > -- > > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscrib e@googlegroups.com> > > . > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-talk?hl=en.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
Thanks Freddie - it worked. There is another error which I am currently searching for answer but maybe you already have? Processing ApplicationController#index (for 127.0.0.1 at 2009-12-22 03:15:41) [GET] ActionController::RoutingError (No route matches "/admin/author/new" with {:method=>:get}): /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'' /usr/lib/ruby/1.8/webrick/server.rb:162:in `start'' /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'' /usr/lib/ruby/1.8/webrick/server.rb:95:in `start'' /usr/lib/ruby/1.8/webrick/server.rb:92:in `each'' /usr/lib/ruby/1.8/webrick/server.rb:92:in `start'' /usr/lib/ruby/1.8/webrick/server.rb:23:in `start'' /usr/lib/ruby/1.8/webrick/server.rb:82:in `start'' Rendering rescues/layout (not_found) D On Mon, Dec 21, 2009 at 10:26 PM, Frederick Cheung < frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On Dec 21, 11:17 am, dwhitekiss <dwhitek...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > *author_test.rb* > > > > require File.dirname(__FILE__) + ''/../test_helper'' > > class AuthorTest < Test::Unit::TestCase > > fixtures :authors > > Pre Rails 2.3 rails used to add a bunch of methods to > Test::Unit::TestCase (such as stuff to do with fixtures). > Post Rails 2.3 it no longer does that. If you want your test cases to > have access to rails specific stuff, your test cases should inherit > from ActiveSupport::TestCase > > Fred > > > def test_name > > author = Author.create(:first_name => ''Joel'',:last_name => ''Spolsky'') > > assert_equal ''Joel Spolsky'', author.name > > end > > end > > > > On Mon, Dec 21, 2009 at 8:36 AM, Frederick Cheung < > > > > > > > > frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > On Dec 21, 4:38 am, dwhitekiss <dwhitek...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hi All, > > > > > > Now I am not sure anymore if I was not able to define the fixtures or > > > > where should it be corrected. > > > > > What does author_test.rb look like ? (Additionally these days you > > > might as well just stick fixtures :all in test_helper.rb rather than > > > specifying them in individual test files) > > > > > Fred > > > > > > D > > > > > -- > > > > > 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<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org><rubyonrails-talk%2Bunsubscrib > e@googlegroups.com> > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Dwhitekiss Dwhitekiss wrote:> *author_test.rb* > > require File.dirname(__FILE__) + ''/../test_helper'' > class AuthorTest < Test::Unit::TestCase > fixtures :authorsRails fixtures are horrible things. Avoid them. Use Machinist or similar. Also consider RSpec instead of Test::Unit.> def test_name > author = Author.create(:first_name => ''Joel'',:last_name => > ''Spolsky'') > assert_equal ''Joel Spolsky'', author.name > end > end > > >Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Dec 21, 7:31 pm, dwhitekiss <dwhitek...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Thanks Freddie - it worked. > > There is another error which I am currently searching for answer but maybe > you already have? >That''s just rails'' equivalent of a 404. Fred> Processing ApplicationController#index (for 127.0.0.1 at 2009-12-22 > 03:15:41) [GET] > > ActionController::RoutingError (No route matches "/admin/author/new" with > {:method=>:get}): > /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' > /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' > /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'' > /usr/lib/ruby/1.8/webrick/server.rb:162:in `start'' > /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'' > /usr/lib/ruby/1.8/webrick/server.rb:95:in `start'' > /usr/lib/ruby/1.8/webrick/server.rb:92:in `each'' > /usr/lib/ruby/1.8/webrick/server.rb:92:in `start'' > /usr/lib/ruby/1.8/webrick/server.rb:23:in `start'' > /usr/lib/ruby/1.8/webrick/server.rb:82:in `start'' > > Rendering rescues/layout (not_found) > > D > > On Mon, Dec 21, 2009 at 10:26 PM, Frederick Cheung < > > > > frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > On Dec 21, 11:17 am, dwhitekiss <dwhitek...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > *author_test.rb* > > > > require File.dirname(__FILE__) + ''/../test_helper'' > > > class AuthorTest < Test::Unit::TestCase > > > fixtures :authors > > > Pre Rails 2.3 rails used to add a bunch of methods to > > Test::Unit::TestCase (such as stuff to do with fixtures). > > Post Rails 2.3 it no longer does that. If you want your test cases to > > have access to rails specific stuff, your test cases should inherit > > from ActiveSupport::TestCase > > > Fred > > > > def test_name > > > author = Author.create(:first_name => ''Joel'',:last_name => ''Spolsky'') > > > assert_equal ''Joel Spolsky'', author.name > > > end > > > end > > > > On Mon, Dec 21, 2009 at 8:36 AM, Frederick Cheung < > > > > frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > On Dec 21, 4:38 am, dwhitekiss <dwhitek...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hi All, > > > > > > Now I am not sure anymore if I was not able to define the fixtures or > > > > > where should it be corrected. > > > > > What does author_test.rb look like ? (Additionally these days you > > > > might as well just stick fixtures :all in test_helper.rb rather than > > > > specifying them in individual test files) > > > > > Fred > > > > > > D > > > > > -- > > > > > 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@googlegroups.com > > . > > > > To unsubscribe from this group, send email to > > > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscrib e@googlegroups.com><rubyonrails-talk%2Bunsubscrib > > e@googlegroups.com> > > > > . > > > > For more options, visit this group at > > > >http://groups.google.com/group/rubyonrails-talk?hl=en. > > > -- > > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscrib e@googlegroups.com> > > . > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-talk?hl=en.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.