2023-05-24 19:55:40 +10:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'rails_helper'
|
|
|
|
require 'mastodon/cli/upgrade'
|
|
|
|
|
|
|
|
describe Mastodon::CLI::Upgrade do
|
2023-12-04 20:08:47 +11:00
|
|
|
let(:cli) { described_class.new }
|
|
|
|
|
2023-12-01 23:00:34 +11:00
|
|
|
it_behaves_like 'CLI Command'
|
2023-12-04 20:08:47 +11:00
|
|
|
|
|
|
|
describe '#storage_schema' do
|
|
|
|
context 'with records that dont need upgrading' do
|
|
|
|
let(:options) { {} }
|
|
|
|
|
|
|
|
before do
|
|
|
|
Fabricate(:account)
|
|
|
|
Fabricate(:media_attachment)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'does not upgrade storage for the attachments' do
|
|
|
|
expect { cli.invoke(:storage_schema, [], options) }.to output(
|
|
|
|
a_string_including('Upgraded storage schema of 0 records')
|
|
|
|
).to_stdout
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2023-05-24 19:55:40 +10:00
|
|
|
end
|