Functional testing joins table problem

I have models/controllers

Class Facility
has_many :facilities_services, :dependent => :delete_all

Class Service
has_many :facilities_services, :dependent => :delete_all

Class FacilitiesServices
belongs_to :facility
belongs_to :service

so in my test/functional/facilities_controller_test.rb, I have

post :destroy, :id => 5

which tosses an error…

test_destroy(FacilitiesControllerTest):
NameError: uninitialized constant Facility::FacilitiesService
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:477:in
const_missing' (eval):1:inconfigure_dependency_for_has_many’

Is this because the Model for the join table should have been,
FacilitiesService ?

Craig

Yes. Looks that way.

On Wed, 2008-05-28 at 11:37 -0700, JDevine wrote:

test_destroy(FacilitiesControllerTest):
NameError: uninitialized constant Facility::FacilitiesService
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:477:in const_missing' (eval):1:inconfigure_dependency_for_has_many’

Is this because the Model for the join table should have been,
FacilitiesService ?


yup…thank heavens for sed

Thanks

Craig