Error when running functional test - Errno::ENOENT

Hello,

I’m getting an error when running functional tests as follows, using
Mac OSX 10.4.9, Rails 1.2.3 .

When I run:

ruby test/functional/campaign_controller_test.rb

I get this error:

Started
E
Finished in 0.027402 seconds.

  1. Error:
    test_should_get_icon_data(CampaignControllerTest):
    Errno::ENOENT: No such file or directory - /usr/src/projects/myproject/
    config/…/test/fixtures/campaings
    /sw/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
    fixtures.rb:344:in open' /sw/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/ fixtures.rb:344:inentries’
    /sw/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
    fixtures.rb:344:in read_fixture_files' /sw/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/ fixtures.rb:281:ininitialize’
    /sw/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
    fixtures.rb:251:in new' /sw/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/ fixtures.rb:251:increate_fixtures’
    /sw/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
    fixtures.rb:250:in map' /sw/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/ fixtures.rb:250:increate_fixtures’
    /sw/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
    base.rb:867:in silence' /sw/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/ fixtures.rb:248:increate_fixtures’
    /sw/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
    fixtures.rb:593:in load_fixtures' /sw/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/ fixtures.rb:538:insetup_with_fixtures’
    /sw/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
    fixtures.rb:575:in `setup’

1 tests, 0 assertions, 0 failures, 1 errors

The file at /usr/src/projects/myproject/config/…/test/fixtures/
campaings is a valid yml file (campaings.yml) that loads fine in unit
tests. My functional test looks like:

require File.dirname(FILE) + ‘/…/test_helper’
require ‘campaign_controller’

Re-raise errors caught by the controller.

class CampaignController; def rescue_action(e) raise e end; end

class CampaignControllerTest < Test::Unit::TestCase
fixtures :campaings

def setup
@controller = CampaignController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
end
end

So I havent modified it at all and still I get this error. I have
tried adding some basic tests, but I still get the same error.

Any help figuring this out will be much appreciated!

Cheers,

nick

Hi Nick,

Nickb wrote:

  1. Error:
    test_should_get_icon_data(CampaignControllerTest):
    Errno::ENOENT: No such file or directory - /usr/src/projects/myproject/
    config/…/test/fixtures/campaings

Assuming you copy/pasted the error, I’d suggest the problem may be
exposed
in the order of the last three letters of the last line above.

hth,
Bill

Its always the simple things! Thanks for the help.

Nickb wrote:

Its always the simple things! Thanks for the help.

Been there. Done that. :wink: Glad to help.

Best regards,
Bill