Fixing Rubocop's auto-correct recommendations (#16098)

```shell
$ bundle exec rubocop --auto-correct
```
This commit is contained in:
Jeremy Friesen 2022-01-13 21:40:19 -05:00 committed by GitHub
parent fd67b238ea
commit f3bc5e5db2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 12 additions and 15 deletions

View file

@ -54,7 +54,6 @@ end
num_users = 10 * SEEDS_MULTIPLIER
# rubocop:disable Metrics/BlockLength
users_in_random_order = seeder.create_if_none(User, num_users) do
roles = %i[trusted workshop_pass]
@ -181,8 +180,6 @@ users_in_random_order = seeder.create_if_none(User, num_users) do
User.order(Arel.sql("RANDOM()"))
end
# rubocop:enable Metrics/BlockLength
seeder.create_if_doesnt_exist(User, "email", "admin@forem.local") do
user = User.create!(
name: "Admin McAdmin",
@ -370,7 +367,7 @@ seeder.create_if_none(Broadcast) do
github_connect: "You're on a roll! 🎉 Do you have a GitHub account? " \
"Consider <a href='/settings'>connecting it</a> so you can pin any of your repos to your profile.",
google_oauth2_connect: "You're on a roll! 🎉 Do you have a Google account? " \
"Consider <a href='/settings'>connecting it</a>.",
"Consider <a href='/settings'>connecting it</a>.",
apple_connect: "You're on a roll! 🎉 Do you have an Apple account? " \
"Consider <a href='/settings'>connecting it</a>.",
customize_feed:

View file

@ -30,9 +30,9 @@ module DataUpdateScripts
Honeybadger.notify(e, context: {
community_name: Settings::Community.community_name,
app_domain: Settings::General.app_domain,
app_domain: Settings::General.app_domain
},
tags: "failed_svg_conversion")
tags: "failed_svg_conversion")
end
end
end

View file

@ -128,7 +128,7 @@ RSpec.describe "Pages", type: :request do
it "redirects to the latest welcome thread" do
earlier_welcome_thread = create(:article, user: user, tags: "welcome")
earlier_welcome_thread.update(published_at: Time.current - 1.week)
earlier_welcome_thread.update(published_at: 1.week.ago)
latest_welcome_thread = create(:article, user: user, tags: "welcome")
get "/welcome"
@ -160,7 +160,7 @@ RSpec.describe "Pages", type: :request do
it "redirects to the latest challenge thread" do
earlier_challenge_thread = create(:article, user: user, tags: "challenge")
earlier_challenge_thread.update(published_at: Time.current - 1.week)
earlier_challenge_thread.update(published_at: 1.week.ago)
latest_challenge_thread = create(:article, user: user, tags: "challenge")
get "/challenge"

View file

@ -50,7 +50,7 @@ RSpec.describe Notifications::Reactions::Send, type: :service do
context "when a reaction is persisted and has siblings" do
before do
create(:reaction, reactable: article, user: user3, created_at: Time.current - 1.day)
create(:reaction, reactable: article, user: user3, created_at: 1.day.ago)
end
it "creates a notification" do

View file

@ -6,7 +6,7 @@ RSpec.describe RateLimitChecker, type: :service do
let(:rate_limit_checker) { described_class.new(user) }
def cache_key(action)
rate_limit_checker.__send__("limit_cache_key", action)
rate_limit_checker.__send__(:limit_cache_key, action)
end
describe "#limit_by_action" do

View file

@ -64,7 +64,7 @@ RSpec.describe "Authenticating with Apple", vcr: { cassette_name: "fastly_sloan"
end
after do
OmniAuth.config.on_failure = OmniauthHelpers.const_get("OMNIAUTH_DEFAULT_FAILURE_HANDLER")
OmniAuth.config.on_failure = OmniauthHelpers.const_get(:OMNIAUTH_DEFAULT_FAILURE_HANDLER)
end
it "does not create a new user" do

View file

@ -96,7 +96,7 @@ RSpec.describe "Authenticating with Facebook" do
end
after do
OmniAuth.config.on_failure = OmniauthHelpers.const_get("OMNIAUTH_DEFAULT_FAILURE_HANDLER")
OmniAuth.config.on_failure = OmniauthHelpers.const_get(:OMNIAUTH_DEFAULT_FAILURE_HANDLER)
end
it "does not create a new user" do

View file

@ -95,7 +95,7 @@ RSpec.describe "Authenticating with Forem" do
end
after do
OmniAuth.config.on_failure = OmniauthHelpers.const_get("OMNIAUTH_DEFAULT_FAILURE_HANDLER")
OmniAuth.config.on_failure = OmniauthHelpers.const_get(:OMNIAUTH_DEFAULT_FAILURE_HANDLER)
end
it "does not create a new user" do

View file

@ -63,7 +63,7 @@ RSpec.describe "Authenticating with GitHub" do
end
after do
OmniAuth.config.on_failure = OmniauthHelpers.const_get("OMNIAUTH_DEFAULT_FAILURE_HANDLER")
OmniAuth.config.on_failure = OmniauthHelpers.const_get(:OMNIAUTH_DEFAULT_FAILURE_HANDLER)
end
it "does not create a new user" do

View file

@ -59,7 +59,7 @@ RSpec.describe "Authenticating with Twitter" do
end
after do
OmniAuth.config.on_failure = OmniauthHelpers.const_get("OMNIAUTH_DEFAULT_FAILURE_HANDLER")
OmniAuth.config.on_failure = OmniauthHelpers.const_get(:OMNIAUTH_DEFAULT_FAILURE_HANDLER)
end
it "does not create a new user" do