0
0
Fork 0

Fix Lint/ConstantDefinitionInBlock cop (#24763)

This commit is contained in:
Matt Jankowski 2023-05-03 04:32:30 -04:00 committed by GitHub
parent 8b636a29c6
commit 3df665fd23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 120 additions and 118 deletions

View file

@ -3,18 +3,20 @@
require 'rails_helper'
RSpec.describe AccountableConcern do
class Hoge
include AccountableConcern
attr_reader :current_account
let(:hoge_class) do
Class.new do
include AccountableConcern
attr_reader :current_account
def initialize(current_account)
@current_account = current_account
def initialize(current_account)
@current_account = current_account
end
end
end
let(:user) { Fabricate(:account) }
let(:target) { Fabricate(:account) }
let(:hoge) { Hoge.new(user) }
let(:hoge) { hoge_class.new(user) }
describe '#log_action' do
it 'creates Admin::ActionLog' do

View file

@ -3,14 +3,16 @@
require 'rails_helper'
describe ApplicationController, type: :controller do
class WrappedActor
attr_reader :wrapped_account
let(:wrapped_actor_class) do
Class.new do
attr_reader :wrapped_account
def initialize(wrapped_account)
@wrapped_account = wrapped_account
def initialize(wrapped_account)
@wrapped_account = wrapped_account
end
delegate :uri, :keypair, to: :wrapped_account
end
delegate :uri, :keypair, to: :wrapped_account
end
controller do
@ -93,7 +95,7 @@ describe ApplicationController, type: :controller do
end
context 'with a valid actor that is not an Account' do
let(:actor) { WrappedActor.new(author) }
let(:actor) { wrapped_actor_class.new(author) }
before do
get :success