0
0
Fork 0

Run rubocop formatting except line length (#23632)

This commit is contained in:
Nick Schonning 2023-02-17 16:56:20 -05:00 committed by GitHub
parent 593bb8ce99
commit 669f6d2c0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
71 changed files with 269 additions and 566 deletions

View file

@ -8,10 +8,10 @@ describe Admin::DashboardController, type: :controller do
describe 'GET #index' do
before do
allow(Admin::SystemCheck).to receive(:perform).and_return([
Admin::SystemCheck::Message.new(:database_schema_check),
Admin::SystemCheck::Message.new(:rules_check, nil, admin_rules_path),
Admin::SystemCheck::Message.new(:sidekiq_process_check, 'foo, bar'),
])
Admin::SystemCheck::Message.new(:database_schema_check),
Admin::SystemCheck::Message.new(:rules_check, nil, admin_rules_path),
Admin::SystemCheck::Message.new(:sidekiq_process_check, 'foo, bar'),
])
sign_in Fabricate(:user, role: UserRole.find_by(name: 'Admin'))
end

View file

@ -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

@ -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

@ -64,7 +64,7 @@ RSpec.describe Api::V2::Filters::StatusesController, type: :controller do
end
describe 'GET #show' do
let(:scopes) { 'read:filters' }
let(:scopes) { 'read:filters' }
let!(:status_filter) { Fabricate(:custom_filter_status, custom_filter: filter) }
before do
@ -90,7 +90,7 @@ RSpec.describe Api::V2::Filters::StatusesController, type: :controller do
end
describe 'DELETE #destroy' do
let(:scopes) { 'write:filters' }
let(:scopes) { 'write:filters' }
let(:status_filter) { Fabricate(:custom_filter_status, custom_filter: filter) }
before do

View file

@ -339,11 +339,11 @@ RSpec.describe Auth::SessionsController, type: :controller do
external_id: public_key_credential.id,
public_key: public_key_credential.public_key,
sign_count: '1000'
)
)
user.webauthn_credentials.take
end
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) }
@ -400,7 +400,7 @@ RSpec.describe Auth::SessionsController, type: :controller do
describe 'GET #webauthn_options' do
context 'with WebAuthn and OTP enabled as second factor' do
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) }

View file

@ -99,7 +99,6 @@ describe AuthorizeInteractionsController do
allow(ResolveAccountService).to receive(:new).and_return(service)
allow(service).to receive(:call).with('user@hostname').and_return(target_account)
post :create, params: { acct: 'acct:user@hostname' }
expect(account.following?(target_account)).to be true

View file

@ -73,7 +73,7 @@ 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

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)

View file

@ -9,12 +9,12 @@ describe WellKnown::HostMetaController, type: :controller do
expect(response).to have_http_status(200)
expect(response.media_type).to eq 'application/xrd+xml'
expect(response.body).to eq <<XML
<?xml version="1.0" encoding="UTF-8"?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
<Link rel="lrdd" template="https://cb6e6126.ngrok.io/.well-known/webfinger?resource={uri}"/>
</XRD>
XML
expect(response.body).to eq <<~XML
<?xml version="1.0" encoding="UTF-8"?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
<Link rel="lrdd" template="https://cb6e6126.ngrok.io/.well-known/webfinger?resource={uri}"/>
</XRD>
XML
end
end
end