Instantly share code, notes, and snippets.

Embed
What would you like to do?
Fixtures file loading order
# test/test_helper.rb
class ActiveRecord::FixtureSet
class << self
alias :orig_create_fixtures :create_fixtures
end
def self.create_fixtures f_dir, fs_names, *args
# delete priority ordering
UserItem.delete_all
reset_cache
# load priority ordering
fs_names = %w(users items) | fs_names
orig_create_fixtures f_dir, fs_names, *args
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment