You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
813 B
35 lines
813 B
# frozen_string_literal: true |
|
|
|
require 'rails_helper' |
|
require 'mastodon/cli/statuses' |
|
|
|
describe Mastodon::CLI::Statuses do |
|
subject { cli.invoke(action, arguments, options) } |
|
|
|
let(:cli) { described_class.new } |
|
let(:arguments) { [] } |
|
let(:options) { {} } |
|
|
|
it_behaves_like 'CLI Command' |
|
|
|
describe '#remove', use_transactional_tests: false do |
|
let(:action) { :remove } |
|
|
|
context 'with small batch size' do |
|
let(:options) { { batch_size: 0 } } |
|
|
|
it 'exits with error message' do |
|
expect { subject } |
|
.to output_results('Cannot run') |
|
.and raise_error(SystemExit) |
|
end |
|
end |
|
|
|
context 'with default batch size' do |
|
it 'removes unreferenced statuses' do |
|
expect { subject } |
|
.to output_results('Done after') |
|
end |
|
end |
|
end |
|
end
|
|
|