Fix Lint/ConstantDefinitionInBlock cop (#24763)
This commit is contained in:
parent
8b636a29c6
commit
3df665fd23
9 changed files with 120 additions and 118 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue