I want to organize my fixtures just like the namespace of my models. So for example if I have a model Company::Employee I''d like the fixture to be in fixtures/company/employees.yml. However, I can''t figure out how to specify the path of the fixture file. If I do: fixtures :employees in my unit test it can''t find the fixture file. Any suggestions? Thanks, Todd http://gabrito.com -- Posted via http://www.ruby-forum.com/.
> I want to organize my fixtures just like the namespace of my > models. So > for example if I have a model Company::Employee I''d like the > fixture to > be in fixtures/company/employees.yml. > > However, I can''t figure out how to specify the path of the > fixture file. > If I do: > > fixtures :employees > > in my unit test it can''t find the fixture file. Any suggestions?Haven''t tried but something like fixtures ''company/employees'' or fixtures ''/company/employees'' might work Ross
Try this:
require File.dirname(__FILE__) + ''/../../test_helper''
class Messaging::BulletinTest < Test::Unit::TestCase
Test::Unit::TestCase.fixture_path= File.dirname(__FILE__)
+"/../../fixtures/messaging"
fixtures :messaging_bulletins
set_fixture_class :messaging_bulletins => Messaging::Bulletin
def test_database
assert_equal messaging_bulletins(:one).id, 1
end
end
--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---