0
0
Fork 0

Add coverage for CLI::Statuses command (#25321)

This commit is contained in:
Matt Jankowski 2023-10-16 09:37:22 -04:00 committed by GitHub
parent 299aa71c8f
commit 00e92b4038
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 0 deletions

View file

@ -4,9 +4,31 @@ require 'rails_helper'
require 'mastodon/cli/statuses'
describe Mastodon::CLI::Statuses do
let(:cli) { described_class.new }
describe '.exit_on_failure?' do
it 'returns true' do
expect(described_class.exit_on_failure?).to be true
end
end
describe '#remove', use_transactional_tests: false do
context 'with small batch size' do
let(:options) { { batch_size: 0 } }
it 'exits with error message' do
expect { cli.invoke :remove, [], options }.to output(
a_string_including('Cannot run')
).to_stdout.and raise_error(SystemExit)
end
end
context 'with default batch size' do
it 'removes unreferenced statuses' do
expect { cli.invoke :remove }.to output(
a_string_including('Done after')
).to_stdout
end
end
end
end