Merge remote-tracking branch 'parent/main' into kbtopic-remove-quote
This commit is contained in:
commit
04070aa608
50 changed files with 2139 additions and 2333 deletions
|
@ -70,6 +70,25 @@ RSpec.describe Mastodon::CLI::Accounts do
|
|||
end
|
||||
end
|
||||
|
||||
context 'with min_age setting' do
|
||||
let(:options) { { email: 'tootctl@example.com', confirmed: true } }
|
||||
|
||||
before do
|
||||
Setting.min_age = 42
|
||||
end
|
||||
|
||||
it_behaves_like 'a new user with given email address and username'
|
||||
|
||||
it 'creates a new user with confirmed status' do
|
||||
expect { subject }
|
||||
.to output_results('New password')
|
||||
|
||||
user = User.find_by(email: options[:email])
|
||||
|
||||
expect(user.confirmed?).to be(true)
|
||||
end
|
||||
end
|
||||
|
||||
context 'with --confirmed option' do
|
||||
let(:options) { { email: 'tootctl@example.com', confirmed: true } }
|
||||
|
||||
|
|
|
@ -125,6 +125,7 @@ RSpec.describe ActivityPub::FetchAllRepliesWorker do
|
|||
before do
|
||||
stub_const('Status::FetchRepliesConcern::FETCH_REPLIES_ENABLED', true)
|
||||
allow(FetchReplyWorker).to receive(:push_bulk)
|
||||
allow(FetchReplyWorker).to receive(:perform_async)
|
||||
all_items.each do |item|
|
||||
next if [top_note_uri, reply_note_uri].include? item
|
||||
|
||||
|
@ -146,6 +147,12 @@ RSpec.describe ActivityPub::FetchAllRepliesWorker do
|
|||
got_uris = subject.perform(status.id)
|
||||
expect(got_uris).to match_array(top_items + top_items_paged)
|
||||
end
|
||||
|
||||
it 'fetches the top status only once' do
|
||||
_ = subject.perform(status.id, { request_id: 0 })
|
||||
expect(FetchReplyWorker).to have_received(:perform_async).with(top_note_uri, { prefetched_body: top_object.deep_stringify_keys, request_id: 0 })
|
||||
expect(a_request(:get, top_note_uri)).to have_been_made.once
|
||||
end
|
||||
end
|
||||
|
||||
describe 'perform' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue