Merge branch 'main' into glitch-soc/merge-upstream

Conflicts:
- `.github/dependabot.yml`:
  Upstream made changes while we have dropped this file.
  Keep the file deleted.
- `.prettierignore`:
  Upstream made changes at the end of the file, where we
  had our extra lines.
  Just moved our extra lines back at the end.
- `app/serializers/initial_state_serializer.rb`:
  Upstream code style changes.
  Applied them.
- `app/services/backup_service.rb`:
  Upstream code style changes.
  Applied them.
This commit is contained in:
Claire
2023-02-19 10:42:55 +01:00
391 changed files with 6713 additions and 3145 deletions

View File

@@ -35,7 +35,7 @@ describe Api::V1::Accounts::CredentialsController do
source: {
privacy: 'unlisted',
sensitive: true,
}
},
}
end
@@ -70,7 +70,7 @@ describe Api::V1::Accounts::CredentialsController do
it 'returns http success' do
expect(response).to have_http_status(200)
end
end
end
describe 'with invalid data' do
before do

View File

@@ -65,7 +65,7 @@ RSpec.describe Api::V1::Admin::AccountsController, type: :controller do
it "returns the correct accounts (#{expected_results.inspect})" do
json = body_as_json
expect(json.map { |a| a[:id].to_i }).to eq (expected_results.map { |symbol| send(symbol).id })
expect(json.map { |a| a[:id].to_i }).to eq(expected_results.map { |symbol| send(symbol).id })
end
end
end

View File

@@ -28,7 +28,7 @@ RSpec.describe Api::V1::AppsController, type: :controller do
end
it 'creates an OAuth app' do
expect(Doorkeeper::Application.find_by(name: client_name)).to_not be nil
expect(Doorkeeper::Application.find_by(name: client_name)).to_not be_nil
end
it 'returns client ID and client secret' do

View File

@@ -42,7 +42,7 @@ RSpec.describe Api::V1::MarkersController, type: :controller do
it 'creates a marker' do
expect(user.markers.first.timeline).to eq 'home'
expect(user.markers.first.last_read_id).to eq 69420
expect(user.markers.first.last_read_id).to eq 69_420
end
end
@@ -58,7 +58,7 @@ RSpec.describe Api::V1::MarkersController, type: :controller do
it 'updates a marker' do
expect(user.markers.first.timeline).to eq 'home'
expect(user.markers.first.last_read_id).to eq 70120
expect(user.markers.first.last_read_id).to eq 70_120
end
end
end

View File

@@ -20,7 +20,7 @@ describe Api::V1::Push::SubscriptionsController do
p256dh: 'BEm_a0bdPDhf0SOsrnB2-ategf1hHoCnpXgQsFj5JCkcoMrMt2WHoPfEYOYPzOIs9mZE8ZUaD7VA5vouy0kEkr8=',
auth: 'eH_C8rq2raXqlcBVDa1gLg==',
},
}
},
}.with_indifferent_access
end
@@ -37,8 +37,8 @@ describe Api::V1::Push::SubscriptionsController do
mention: false,
poll: true,
status: false,
}
}
},
},
}.with_indifferent_access
end

View File

@@ -20,7 +20,7 @@ RSpec.describe Api::V1::ReportsController, type: :controller do
let(:target_account) { status.account }
let(:category) { nil }
let(:forward) { nil }
let(:rule_ids){ nil }
let(:rule_ids) { nil }
before do
allow(AdminMailer).to receive(:new_report).and_return(double('email', deliver_later: nil))

View File

@@ -31,7 +31,7 @@ RSpec.describe Api::V1::Statuses::FavouritedByAccountsController, type: :control
it 'returns accounts who favorited the status' do
get :index, params: { status_id: status.id, limit: 2 }
expect(body_as_json.size).to eq 2
expect([body_as_json[0][:id], body_as_json[1][:id]]).to match_array([alice.id.to_s, bob.id.to_s])
expect([body_as_json[0][:id], body_as_json[1][:id]]).to match_array([alice.id.to_s, bob.id.to_s])
end
it 'does not return blocked users' do

View File

@@ -31,7 +31,7 @@ RSpec.describe Api::V1::Statuses::RebloggedByAccountsController, type: :controll
it 'returns accounts who reblogged the status' do
get :index, params: { status_id: status.id, limit: 2 }
expect(body_as_json.size).to eq 2
expect([body_as_json[0][:id], body_as_json[1][:id]]).to match_array([alice.id.to_s, bob.id.to_s])
expect([body_as_json[0][:id], body_as_json[1][:id]]).to match_array([alice.id.to_s, bob.id.to_s])
end
it 'does not return blocked users' do

View File

@@ -195,7 +195,7 @@ RSpec.describe Api::V1::StatusesController, type: :controller do
end
it 'removes the status' do
expect(Status.find_by(id: status.id)).to be nil
expect(Status.find_by(id: status.id)).to be_nil
end
end

View File

@@ -38,7 +38,7 @@ describe Api::V1::StreamingController do
[:scheme, :path, :query, :fragment].each do |part|
expect(redirect_to_uri.send(part)).to eq(request_uri.send(part)), "redirect target #{part}"
end
expect(redirect_to_uri.host).to eq(@streaming_host), "redirect target host"
expect(redirect_to_uri.host).to eq(@streaming_host), 'redirect target host'
end
end
end

View File

@@ -29,7 +29,7 @@ RSpec.describe Api::V1::SuggestionsController, type: :controller do
json = body_as_json
expect(json.size).to be >= 1
expect(json.map { |i| i[:id] }).to include *[bob, jeff].map { |i| i.id.to_s }
expect(json.map { |i| i[:id] }).to include(*[bob, jeff].map { |i| i.id.to_s })
end
end
end