blob: 9882cda7fba3faad861bb1f76ed8c46e9a006737 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# frozen_string_literal: true
require 'spec_helper'
require Rails.root.join('db', 'migrate', '20191213120427_fix_max_pages_size.rb')
describe FixMaxPagesSize do
let(:application_settings) { table(:application_settings) }
let!(:default_setting) { application_settings.create! }
let!(:max_possible_setting) { application_settings.create!(max_pages_size: described_class::MAX_SIZE) }
let!(:higher_than_maximum_setting) { application_settings.create!(max_pages_size: described_class::MAX_SIZE + 1) }
it 'correctly updates settings only if needed' do
migrate!
expect(default_setting.reload.max_pages_size).to eq(100)
expect(max_possible_setting.reload.max_pages_size).to eq(described_class::MAX_SIZE)
expect(higher_than_maximum_setting.reload.max_pages_size).to eq(described_class::MAX_SIZE)
end
end
|