Add spec coverage for `CLI::Upgrade#storage_schema` command (#28180)

This commit is contained in:
Matt Jankowski 2023-12-04 04:08:47 -05:00 committed by GitHub
parent 19ad51253d
commit 1bf2230fd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 0 deletions

View File

@ -4,5 +4,24 @@ require 'rails_helper'
require 'mastodon/cli/upgrade' require 'mastodon/cli/upgrade'
describe Mastodon::CLI::Upgrade do describe Mastodon::CLI::Upgrade do
let(:cli) { described_class.new }
it_behaves_like 'CLI Command' it_behaves_like 'CLI Command'
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
end end