2020-04-24 17:09:48 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2021-06-11 14:10:13 -04:00
|
|
|
require_migration!
|
2020-04-24 17:09:48 -04:00
|
|
|
|
2020-06-24 14:09:03 -04:00
|
|
|
RSpec.describe RemoveAdditionalApplicationSettingsRows do
|
2020-04-24 17:09:48 -04:00
|
|
|
let(:application_settings) { table(:application_settings) }
|
|
|
|
|
|
|
|
it 'removes additional rows from application settings' do
|
|
|
|
3.times { application_settings.create! }
|
|
|
|
latest_settings = application_settings.create!
|
|
|
|
|
|
|
|
disable_migrations_output { migrate! }
|
|
|
|
|
|
|
|
expect(application_settings.count).to eq(1)
|
|
|
|
expect(application_settings.first).to eq(latest_settings)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'leaves only row in application_settings' do
|
|
|
|
latest_settings = application_settings.create!
|
|
|
|
|
|
|
|
disable_migrations_output { migrate! }
|
|
|
|
|
|
|
|
expect(application_settings.first).to eq(latest_settings)
|
|
|
|
end
|
|
|
|
end
|