Skip to content

Commit

Permalink
Fix bug caused by fixture_file_upload reading from ActionController::…
Browse files Browse the repository at this point in the history
…TestCase instead of self.class.

- This should also be fixed in rails-3.1
  - rails/rails#1861
- Fixes #252
  • Loading branch information
dchelimsky committed Jun 25, 2011
1 parent a1604b1 commit 9ad14ae
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/rspec/rails/fixture_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ module FixtureSupport
include ActiveRecord::TestFixtures

included do
# TODO (DC 2011-06-25) this is necessary because fixture_file_upload
# accesses fixture_path directly on ActiveSupport::TestCase. This is
# fixed in rails by https://github.com/rails/rails/pull/1861, which
# should be part of the 3.1 release, at which point we can include
# these lines for rails < 3.1.
ActiveSupport::TestCase.class_eval do
include ActiveRecord::TestFixtures
self.fixture_path = RSpec.configuration.fixture_path
end
# /TODO

self.fixture_path = RSpec.configuration.fixture_path
self.use_transactional_fixtures = RSpec.configuration.use_transactional_fixtures
self.use_instantiated_fixtures = RSpec.configuration.use_instantiated_fixtures
Expand Down

0 comments on commit 9ad14ae

Please sign in to comment.