Hi,
I am seeing some strangeness with fixture loading in our suite of specs.
1st up any join table fixture or namespaced model causes an error in
test.log
example
Unable to load advertising_channels_position_profile, underlying
cause no such file to load – advertising_channels_position_profile /
Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in
`gem_original_require’/
it seems to looking for a model corresponding with a fixture, since
this is a join table fixture there is no model
Further weirdness is when using transactional fixtures
i get loads of errors like “Can’t find User with ID=1” when i know the
record is in the db
i can output the db contents along side it.
all these errors dissapear with transactional fixtures turned off
a majority of the specs i have looked at pass individually but error
when run by autotest or verify with spec rcov
Anyone got any ideas
rails 2.1
rspec 1.1.4
ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0]
Cheers
Steven
/************************************************/
Steven H.
Programmer, Web D., IT Consultant
Composer, Producer, Performer, DJ
/************************************************/
I am seeing what I think is the same issue - but slightly different
characteristics. My site was started from scratch in Rails 2.1 (no
upgrade). The ‘missing file’ appears to me to be because the whatever
infers association names isn’t pluralizing both halves. There is no
file roles_user.yml because it is roles_users.yml.
Other differences:
Changing transactional fixtures to ‘false’ do not fix this for me
And I am using Enterprise Ruby 1.8.6-20080709
Unable to load roles_user, underlying cause no such file to load –
roles_user
/software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' /software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
require’
/software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencie
s.rb:509:in require' /software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencie\ s.rb:354:in
new_constants_in’
/software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencie
s.rb:509:in require' /software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencie\ s.rb:101:in
require_or_load’
/software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencie
s.rb:60:in depend_on' /software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencie\ s.rb:456:in
require_dependency’
/software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/fixtures.rb:8
55:in try_to_load_dependency' /software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/fixtures.rb:8\ 70:in
require_fixture_classes’
/software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/fixtures.rb:8
67:in each' /software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/fixtures.rb:8\ 67:in
require_fixture_classes’
/software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/fixtures.rb:8
50:in fixtures' ./test/integration/../test_helper.rb:41 ./test/integration/page_permissions_test.rb:1:in
require’
./test/integration/page_permissions_test.rb:1
/software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake/rake_test_loader.rb:5:in
load' /software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake/rake_test_loader.rb:5 /software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake/rake_test_loader.rb:5:in
each’
/software/stow/ruby-enterprise-1.8.6-20080709/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake/rake_test_loader.rb:5
On 21 Aug 2008, at 17:48, Cynthia K. wrote:
I am seeing what I think is the same issue - but slightly different
characteristics. My site was started from scratch in Rails 2.1 (no
upgrade). The ‘missing file’ appears to me to be because the whatever
infers association names isn’t pluralizing both halves. There is no
file roles_user.yml because it is roles_users.yml.
It sounds like it’s spotting your roles_users.yml fixture and trying
to load the matching class (RolesUser from roles_user). If that’s just
a habtm then there is no such model (and that fixture file isn’t
actually necessary if you use the foxy fixtures stuff in rails 2.0 &
above)
Fred