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

@@ -37,7 +37,7 @@ describe Settings::ApplicationsController do
end
describe 'GET #new' do
it 'works' do
it 'returns http success' do
get :new
expect(response).to have_http_status(200)
end
@@ -51,8 +51,8 @@ describe Settings::ApplicationsController do
name: 'My New App',
redirect_uri: 'urn:ietf:wg:oauth:2.0:oob',
website: 'http://google.com',
scopes: 'read write follow'
}
scopes: 'read write follow',
},
}
response
end
@@ -73,8 +73,8 @@ describe Settings::ApplicationsController do
name: 'My New App',
redirect_uri: 'urn:ietf:wg:oauth:2.0:oob',
website: 'http://google.com',
scopes: [ 'read', 'write', 'follow' ]
}
scopes: ['read', 'write', 'follow'],
},
}
response
end
@@ -95,8 +95,8 @@ describe Settings::ApplicationsController do
name: '',
redirect_uri: '',
website: '',
scopes: []
}
scopes: [],
},
}
end
@@ -112,16 +112,16 @@ describe Settings::ApplicationsController do
describe 'PATCH #update' do
context 'success' do
let(:opts) {
let(:opts) do
{
website: 'https://foo.bar/'
website: 'https://foo.bar/',
}
}
end
def call_update
patch :update, params: {
id: app.id,
doorkeeper_application: opts
doorkeeper_application: opts,
}
response
end
@@ -144,8 +144,8 @@ describe Settings::ApplicationsController do
name: '',
redirect_uri: '',
website: '',
scopes: []
}
scopes: [],
},
}
end
@@ -175,12 +175,13 @@ describe Settings::ApplicationsController do
describe 'regenerate' do
let(:token) { user.token_for_app(app) }
before do
expect(token).to_not be_nil
post :regenerate, params: { id: app.id }
end
it 'should create new token' do
it 'creates new token' do
expect(user.token_for_app(app)).to_not eql(token)
end
end

View File

@@ -7,8 +7,8 @@ RSpec.describe Settings::ImportsController, type: :controller do
sign_in Fabricate(:user), scope: :user
end
describe "GET #show" do
it "returns http success" do
describe 'GET #show' do
it 'returns http success' do
get :show
expect(response).to have_http_status(200)
end
@@ -21,8 +21,8 @@ RSpec.describe Settings::ImportsController, type: :controller do
post :create, params: {
import: {
type: 'following',
data: fixture_file_upload('imports.txt')
}
data: fixture_file_upload('imports.txt'),
},
}
expect(response).to redirect_to(settings_import_path)
@@ -34,8 +34,8 @@ RSpec.describe Settings::ImportsController, type: :controller do
post :create, params: {
import: {
type: 'blocking',
data: fixture_file_upload('imports.txt')
}
data: fixture_file_upload('imports.txt'),
},
}
expect(response).to redirect_to(settings_import_path)

View File

@@ -90,7 +90,7 @@ describe Settings::MigrationsController do
end
end
context 'when a recent migration already exists ' do
context 'when a recent migration already exists' do
let(:acct) { Fabricate(:account, also_known_as: [ActivityPub::TagManager.instance.uri_for(user.account)]) }
before do

View File

@@ -25,7 +25,7 @@ describe Settings::Preferences::NotificationsController do
user: {
notification_emails: { follow: '1' },
interactions: { must_be_follower: '0' },
}
},
}
expect(response).to redirect_to(settings_preferences_notifications_path)

View File

@@ -34,7 +34,7 @@ describe Settings::Preferences::OtherController do
user: {
setting_boost_modal: '1',
setting_delete_modal: '0',
}
},
}
expect(response).to redirect_to(settings_preferences_other_path)

View File

@@ -10,8 +10,8 @@ RSpec.describe Settings::ProfilesController, type: :controller do
sign_in user, scope: :user
end
describe "GET #show" do
it "returns http success" do
describe 'GET #show' do
it 'returns http success' do
get :show
expect(response).to have_http_status(200)
end

View File

@@ -5,6 +5,7 @@ describe Settings::SessionsController do
let(:user) { Fabricate(:user) }
let(:session_activation) { Fabricate(:session_activation, user: user) }
before { sign_in user, scope: :user }
describe 'DELETE #destroy' do

View File

@@ -5,7 +5,6 @@ require 'rails_helper'
describe Settings::TwoFactorAuthentication::ConfirmationsController do
render_views
shared_examples 'renders :new' do
it 'renders the new view' do
subject

View File

@@ -7,7 +7,7 @@ describe Settings::TwoFactorAuthentication::WebauthnCredentialsController do
render_views
let(:user) { Fabricate(:user) }
let(:domain) { "#{Rails.configuration.x.use_https ? 'https' : 'http' }://#{Rails.configuration.x.web_domain}" }
let(:domain) { "#{Rails.configuration.x.use_https ? 'https' : 'http'}://#{Rails.configuration.x.web_domain}" }
let(:fake_client) { WebAuthn::FakeClient.new(domain) }
def add_webauthn_credential(user)
@@ -137,7 +137,7 @@ describe Settings::TwoFactorAuthentication::WebauthnCredentialsController do
expect { get :options }.to_not change { user.webauthn_id }
end
it "includes existing credentials in list of excluded credentials" do
it 'includes existing credentials in list of excluded credentials' do
get :options
excluded_credentials_ids = JSON.parse(response.body)['excludeCredentials'].map { |credential| credential['id'] }