Skip to content

Instantly share code, notes, and snippets.

@ghiculescu
Last active November 21, 2022 16:13
Show Gist options
  • Save ghiculescu/3e7a1f40cdae0617e7530027ce876f12 to your computer and use it in GitHub Desktop.
Save ghiculescu/3e7a1f40cdae0617e7530027ce876f12 to your computer and use it in GitHub Desktop.
if defined?(ActiveRecord::Base)
begin
ActiveRecord::Migration.maintain_test_schema!
rescue ActiveRecord::PendingMigrationError => e
puts e.to_s.strip
exit 1
end
end
ActiveSupport.on_load(:active_support_test_case) do
if defined?(ActiveRecord::Base)
include ActiveRecord::TestDatabases
include ActiveRecord::TestFixtures
end
self.fixture_path = "#{Rails.root}/test/fixtures/"
self.file_fixture_path = fixture_path + "files"
end
ActiveSupport.on_load(:action_dispatch_integration_test) do
self.fixture_path = ActiveSupport::TestCase.fixture_path
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment