0
0
Fork 0

Formalize some patterns in cli specs (#28255)

This commit is contained in:
Matt Jankowski 2023-12-07 08:49:14 -05:00 committed by GitHub
parent 5d97a897c8
commit ad34d33bfd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 492 additions and 449 deletions

View file

@ -4,23 +4,26 @@ require 'rails_helper'
require 'mastodon/cli/upgrade'
describe Mastodon::CLI::Upgrade do
subject { cli.invoke(action, arguments, options) }
let(:cli) { described_class.new }
let(:arguments) { [] }
let(:options) { {} }
it_behaves_like 'CLI Command'
describe '#storage_schema' do
context 'with records that dont need upgrading' do
let(:options) { {} }
let(:action) { :storage_schema }
context 'with records that dont need upgrading' do
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
expect { subject }
.to output_results('Upgraded storage schema of 0 records')
end
end
end