Hi all, I was wondering how you can test Rails 3 engines. Looks like the rake test task is not available by default. So I added the following in my rake task require ''rake/testtask'' Rake::TestTask.new do |test| test.pattern = ''test/**/*_test.rb'' test.libs << ''test'' end In my test_helper.rb file, I added: ENV["RAILS_ENV"] = "test" require ''rubygems'' require ''test/unit'' require ''active_support'' But still no go. If I want to run the test, I get some error messages about a namespace I''m using (everything else is still running smoothly). So how do you integrate the default rails testing framework from ActiveSupport into your Rails 3 Engines? Thank you in advance -- 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.
Hi, does anyone can help me by telling how you can properly test rails 3 engines? Since engines don''t necessarily have db connections on its own, how can you test your models? I could use a test database, but how do you configure you test then to create and use that connection? Thank you in advance -- 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.
Try Jose Valim''s EngineX (http://github.com/josevalim/enginex). This works really well for me. --> Eric On Oct 12, 3:39 am, Michael Rigart <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi, > > does anyone can help me by telling how you can properly test rails 3 > engines? Since engines don''t necessarily have db connections on its own, > how can you test your models? > > I could use a test database, but how do you configure you test then to > create and use that connection? > > Thank you in advance > > -- > Posted viahttp://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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.