[Rails-core] acts_as_commentable

2006-08-18 Thread Rich Collins
Oops wrong link :S http://pastie.caboo.se/9255 ___ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core

Re: Re: [Rails-core] Clean Functional Tests

2006-08-18 Thread Nathaniel Talbott
On 8/18/06, Keith Morrison <[EMAIL PROTECTED]> wrote: You could define a fake test, but then the test and assertion count will be off. A simple: def default_test end In your abstract test case will prevent the failure, and while you will see an extra test, there will be no assertion inflat

[Rails-core] Associations to non-AR objects

2006-08-18 Thread Michael Schuerig
Today I abused ActiveRecord badly, but to no avail, alas. I tried to make it accept a habtm association to a class that wasn't derived from ActiveRecord::Base. I like to think that I got pretty far stubbing out all kinds of methods in my almost-PORO, when I got bitten by an unrelated bug[*].

Re: [Rails-core] Clean Functional Tests

2006-08-18 Thread Kevin Clark
But the difference here is that has_many is named explicitly. The TestInjector (while cool, don't get me wrong) feels a bit like PFM to save 3 lines in a setup method. It also encourages a 1 class to 1 test case method of testing which I don't think always makes the most sense (see http://glu.tto

Re: [Rails-core] Clean Functional Tests

2006-08-18 Thread Keith Morrison
Rails does a great job of inferring a lot of things based on names, so it seems like a good fit to me. class User < ActiveRecord::Base has_many :assignments end From this class declaration, Rails infers that there is an Assignment model that contains the foreign key user_id. Isn't this the

Re: [Rails-core] Clean Functional Tests

2006-08-18 Thread Kevin Clark
See ActiveRecordTestCase in active_record_unit.rb in actionpack. I defined a test_truth so Test::Unit::TestCase doesn't complain. The test count is slightly inflated, but if you care enough about not having request, response and controller instance variables setup then it's an option. Adding a de

Re: [Rails-core] Clean Functional Tests

2006-08-18 Thread Keith Morrison
Not without even more magic. Test::Unit::TestCase has an inherited method that tries to build a test suite from any test_* methods in the subclass. Executing this code: require 'test/unit' class FunctionalTest < Test::Unit::TestCase; end Produces: 1) Failure: default_test:2 No tests were sp

Re: [Rails-core] Clean Functional Tests

2006-08-18 Thread Kevin Clark
Is there a reason we don't just create a new subclass of Test::Unit::TestCase called ControllerTest (or FunctionalTest) and inheirit from that instead? We don't have to worry about the magic and it's still backwards compatible. -- Kevin Clark http://glu.ttono.us __

Re: [Rails-core] Clean Functional Tests

2006-08-18 Thread Keith Morrison
In that case, the plugin won't help you, but it won't hinder you either. Francois Beausoleil wrote: Hello Keith, 2006/8/17, Keith Morrison <[EMAIL PROTECTED]>: Comments, questions, suggestions? My tests are defined like this now: # test/functional/admin_controller_t

Re: [Rails-core] Problems with new dependency code and plugins

2006-08-18 Thread Julian 'Julik' Tarkhanov
On 16-aug-2006, at 22:27, Francois Beausoleil wrote: Expected /Users/luke/Sandbox/projects/rails_plugin_repository/ config/../vendor/plugins/unobtrusive_javascript/lib/ unobtrusive_javascript.rb to define UnobtrusiveJavascript Moreover, I get the following error in my test environment: LoadE