mirror of
https://github.com/discourse/discourse.git
synced 2024-12-12 20:13:45 +08:00
493d437e79
* Remove outdated option
04078317ba
* Use the non-globally exposed RSpec syntax
https://github.com/rspec/rspec-core/pull/2803
* Use the non-globally exposed RSpec syntax, cont
https://github.com/rspec/rspec-core/pull/2803
* Comply to strict predicate matchers
See:
- https://github.com/rspec/rspec-expectations/pull/1195
- https://github.com/rspec/rspec-expectations/pull/1196
- https://github.com/rspec/rspec-expectations/pull/1277
31 lines
858 B
Ruby
31 lines
858 B
Ruby
# frozen_string_literal: true
|
|
|
|
RSpec.describe FreedomPatches::SchemaMigrationDetails do
|
|
|
|
# we usually don't really need this model so lets not clutter up with it
|
|
class SchemaMigrationDetail < ActiveRecord::Base
|
|
end
|
|
|
|
class TestMigration < ActiveRecord::Migration[4.2]
|
|
def up
|
|
sleep 0.001
|
|
end
|
|
end
|
|
|
|
it "logs information on migration" do
|
|
migration = TestMigration.new("awesome_migration", "20110225050318")
|
|
|
|
ActiveRecord::Base.connection_pool.with_connection do |conn|
|
|
migration.exec_migration(conn, :up)
|
|
end
|
|
|
|
info = SchemaMigrationDetail.find_by(version: "20110225050318")
|
|
|
|
expect(info.duration).to be > 0
|
|
expect(info.git_version).to eq Discourse.git_version
|
|
expect(info.direction).to eq "up"
|
|
expect(info.rails_version).to eq Rails.version
|
|
expect(info.name).to eq "awesome_migration"
|
|
end
|
|
end
|