Rails fixtures - defining a table name?
You can set the class of a given fixture manually like so:
class SomeTest < ActiveSupport::TestCase
set_fixture_class widgets: 'Module::ClassInAModule'
fixtures :widgets # or fixtures :all if you’ve defined all the mappings required
test 'widgets can be found' do
assert Module::ClassInAModule.all.any?, 'there should be widgets'
end
end
Depending on how your tests/test helpers are set up, you may want to move this call to a parent class or something.