From ac3561098e9cd1fd1ccee558295eb9f3430099d6 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Sat, 18 Feb 2023 17:17:59 -0500 Subject: [PATCH] Autofix Rubocop RSpec/LetBeforeExamples (#23671) --- .rubocop_todo.yml | 6 ------ spec/models/user_spec.rb | 6 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 83b2a37aa..1c22c440b 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1121,12 +1121,6 @@ RSpec/LeakyConstantDeclaration: - 'spec/lib/settings/extend_spec.rb' - 'spec/models/concerns/remotable_spec.rb' -# Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). -RSpec/LetBeforeExamples: - Exclude: - - 'spec/models/user_spec.rb' - # Offense count: 108 RSpec/LetSetup: Exclude: diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 368165f16..dde1503c0 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -2,6 +2,9 @@ require 'rails_helper' require 'devise_two_factor/spec_helpers' RSpec.describe User, type: :model do + let(:password) { 'abcd1234' } + let(:account) { Fabricate(:account, username: 'alice') } + it_behaves_like 'two_factor_backupable' describe 'otp_secret' do @@ -96,9 +99,6 @@ RSpec.describe User, type: :model do end end - let(:account) { Fabricate(:account, username: 'alice') } - let(:password) { 'abcd1234' } - describe 'blacklist' do around(:each) do |example| old_blacklist = Rails.configuration.x.email_blacklist