Merge commit 'b896b16cb3c8626fbee12a7eda7f882114b1a040' into glitch-soc/merge-upstream

This commit is contained in:
Claire
2023-05-28 15:01:53 +02:00
40 changed files with 227 additions and 216 deletions

View File

@ -1,9 +1,9 @@
# frozen_string_literal: true
require 'rails_helper'
require 'mastodon/ip_blocks_cli'
require 'mastodon/cli/ip_blocks'
RSpec.describe Mastodon::IpBlocksCLI do
RSpec.describe Mastodon::CLI::IpBlocks do
let(:cli) { described_class.new }
describe '#add' do

View File

@ -1,9 +1,9 @@
# frozen_string_literal: true
require 'rails_helper'
require 'cli'
require 'mastodon/cli/main'
describe Mastodon::CLI do
describe Mastodon::CLI::Main do
describe 'version' do
it 'returns the Mastodon version' do
expect { described_class.new.invoke(:version) }.to output(

View File

@ -1,11 +1,11 @@
# frozen_string_literal: true
require 'rails_helper'
require 'mastodon/settings_cli'
require 'mastodon/cli/settings'
RSpec.describe Mastodon::SettingsCLI do
RSpec.describe Mastodon::CLI::Settings do
describe 'subcommand "registrations"' do
let(:cli) { Mastodon::RegistrationsCLI.new }
let(:cli) { Mastodon::CLI::Registrations.new }
before do
Setting.registrations_mode = nil

View File

@ -7,7 +7,7 @@ describe StatusFilter do
let(:status) { Fabricate(:status) }
context 'without an account' do
subject { described_class.new(status, nil) }
subject(:filter) { described_class.new(status, nil) }
context 'when there are no connections' do
it { is_expected.to_not be_filtered }
@ -22,16 +22,16 @@ describe StatusFilter do
end
context 'when status policy does not allow show' do
before do
it 'filters the status' do
expect_any_instance_of(StatusPolicy).to receive(:show?).and_return(false)
end
it { is_expected.to be_filtered }
expect(filter).to be_filtered
end
end
end
context 'with real account' do
subject { described_class.new(status, account) }
subject(:filter) { described_class.new(status, account) }
let(:account) { Fabricate(:account) }
@ -73,11 +73,11 @@ describe StatusFilter do
end
context 'when status policy does not allow show' do
before do
it 'filters the status' do
expect_any_instance_of(StatusPolicy).to receive(:show?).and_return(false)
end
it { is_expected.to be_filtered }
expect(filter).to be_filtered
end
end
end
end