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

Conflicts:
- `.prettierignore`:
  Upstream added a line at the end of the file, while glitch-soc had its own
  extra lines.
  Took upstream's change.
- `CONTRIBUTING.md`:
  We have our custom CONTRIBUTING.md quoting upstream. Upstream made changes.
  Ported upstream changes.
- `app/controllers/application_controller.rb`:
  Upstream made code style changes in a method that is entirely replaced
  in glitch-soc.
  Ignored the change.
- `app/models/account.rb`:
  Code style changes textually close to glitch-soc-specific changes.
  Ported upstream changes.
- `lib/sanitize_ext/sanitize_config.rb`:
  Upstream code style changes.
  Ignored them.
This commit is contained in:
Claire
2023-02-25 14:00:40 +01:00
946 changed files with 4147 additions and 3072 deletions

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
describe Api::V1::Accounts::CredentialsController do
@@ -51,7 +53,7 @@ describe Api::V1::Accounts::CredentialsController do
expect(user.account.avatar).to exist
expect(user.account.header).to exist
expect(user.setting_default_privacy).to eq('unlisted')
expect(user.setting_default_sensitive).to eq(true)
expect(user.setting_default_sensitive).to be(true)
end
it 'queues up an account update distribution' do
@@ -80,7 +82,7 @@ describe Api::V1::Accounts::CredentialsController do
end
it 'returns http unprocessable entity' do
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(422)
end
end
end
@@ -88,20 +90,20 @@ describe Api::V1::Accounts::CredentialsController do
context 'without an oauth token' do
before do
allow(controller).to receive(:doorkeeper_token) { nil }
allow(controller).to receive(:doorkeeper_token).and_return(nil)
end
describe 'GET #show' do
it 'returns http unauthorized' do
get :show
expect(response).to have_http_status(:unauthorized)
expect(response).to have_http_status(401)
end
end
describe 'PATCH #update' do
it 'returns http unauthorized' do
patch :update, params: { note: 'Foo' }
expect(response).to have_http_status(:unauthorized)
expect(response).to have_http_status(401)
end
end
end

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
describe Api::V1::Accounts::FollowerAccountsController do

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
describe Api::V1::Accounts::FollowingAccountsController do

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
describe Api::V1::Accounts::ListsController do

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
describe Api::V1::Accounts::NotesController do

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
describe Api::V1::Accounts::RelationshipsController do

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe Api::V1::Accounts::SearchController, type: :controller do

View File

@@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
describe Api::V1::Accounts::StatusesController do
@@ -16,7 +17,7 @@ describe Api::V1::Accounts::StatusesController do
it 'returns http success' do
get :index, params: { account_id: user.account.id, limit: 1 }
expect(response).to have_http_status(:ok)
expect(response).to have_http_status(200)
end
it 'returns expected headers' do
@@ -29,7 +30,7 @@ describe Api::V1::Accounts::StatusesController do
it 'returns http success' do
get :index, params: { account_id: user.account.id, only_media: true }
expect(response).to have_http_status(:ok)
expect(response).to have_http_status(200)
end
end
@@ -44,7 +45,7 @@ describe Api::V1::Accounts::StatusesController do
end
it 'returns http success' do
expect(response).to have_http_status(:ok)
expect(response).to have_http_status(200)
end
it 'returns posts along with self replies' do
@@ -63,7 +64,7 @@ describe Api::V1::Accounts::StatusesController do
it 'returns http success' do
get :index, params: { account_id: user.account.id, pinned: true }
expect(response).to have_http_status(:ok)
expect(response).to have_http_status(200)
end
end
@@ -79,7 +80,7 @@ describe Api::V1::Accounts::StatusesController do
it 'returns http success' do
get :index, params: { account_id: account.id, pinned: true }
expect(response).to have_http_status(:ok)
expect(response).to have_http_status(200)
end
context 'when user does not follow account' do