Merge commit '34cd7d6585992c03298c175ab5d22ad059b58cdb' into glitch-soc/merge-upstream

Conflicts:
- `CONTRIBUTING.md`:
  Upstream changed the file, while we had a different one.
  Updated the common parts.
- `README.md`:
  Upstream changed the file, while we had a different one.
  Updated the common parts.
- `app/helpers/application_helper.rb`:
  Upstream added helpers where glitch-soc had extra ones.
  Added upstream's new helpers.
- `app/models/form/admin_settings.rb`:
  Upstream added some custom handling of one setting, while
  glitch-soc had additional code.
  Ported upstream's code.
- `lib/mastodon/version.rb`:
  Upstream moved some things to `config/mastodon.yml`.
  Did the same.
- `spec/requests/api/v1/accounts/credentials_spec.rb`:
  I don't know honestly.
This commit is contained in:
Claire
2025-01-10 20:36:25 +01:00
127 changed files with 1766 additions and 1224 deletions

View File

@@ -3,6 +3,8 @@
require 'rails_helper'
RSpec.describe ApplicationController do
render_views
controller do
def success
head 200
@@ -23,9 +25,22 @@ RSpec.describe ApplicationController do
shared_examples 'respond_with_error' do |code|
it "returns http #{code} for http and renders template" do
expect(subject).to render_template("errors/#{code}", layout: 'error')
subject
expect(response).to have_http_status(code)
expect(response)
.to have_http_status(code)
expect(response.parsed_body)
.to have_css('body[class=error]')
expect(response.parsed_body.css('h1').to_s)
.to include(error_content(code))
end
def error_content(code)
if code == 422
I18n.t('errors.422.content')
else
I18n.t("errors.#{code}")
end
end
end