Rubocop fixes (#1966)

This commit is contained in:
Anna Buianova 2019-03-04 17:18:09 +03:00 committed by Ben Halpern
parent 9226ca8be8
commit 854c7a773c
8 changed files with 11 additions and 5 deletions

View file

@ -32,6 +32,7 @@ AllCops:
- db/schema.rb
- db/migrate/*.rb
- node_modules/**/*
- tmp/**/*
DisplayStyleGuide: true
ExtraDetails: true
TargetRubyVersion: 2.6

View file

@ -49,6 +49,10 @@ Style/ClassAndModuleChildren:
- 'app/controllers/notifications/counts_controller.rb'
- 'app/controllers/notifications/reads_controller.rb'
RSpec/AnyInstance:
Exclude:
- 'spec/requests/stripe_cancellations_spec.rb'
# Offense count: 1283
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https

View file

@ -12,7 +12,7 @@ xml.rss version: "2.0" do
@articles.each do |article|
xml.item do
xml.title article.title
xml.author (@user && @user.class.name == "User") ? @user.name : article.user.name
xml.author @user && @user.class.name == "User" ? @user.name : article.user.name
xml.pubDate article.published_at.to_s(:rfc822) if article.published_at
xml.link "https://dev.to#{article.path}"
xml.guid "https://dev.to#{article.path}"

View file

@ -90,7 +90,7 @@ Rails.application.configure do
# Install the Timber.io logger
send_logs_to_timber = ENV["SEND_LOGS_TO_TIMBER"] || "false" # <---- set to false to stop sending dev logs to Timber.io
log_device = (send_logs_to_timber == "true") ? Timber::LogDevices::HTTP.new(ENV["TIMBER"]) : STDOUT
log_device = send_logs_to_timber == "true" ? Timber::LogDevices::HTTP.new(ENV["TIMBER"]) : STDOUT
logger = Timber::Logger.new(log_device)
logger.level = config.log_level
config.logger = ActiveSupport::TaggedLogging.new(logger)

View file

@ -93,7 +93,7 @@ Rails.application.configure do
# Timber.io logger
send_logs_to_timber = ENV["SEND_LOGS_TO_TIMBER"] || "true" # <---- production should send timber logs by default
log_device = (send_logs_to_timber == "true") ? Timber::LogDevices::HTTP.new(ENV["TIMBER"]) : STDOUT
log_device = send_logs_to_timber == "true" ? Timber::LogDevices::HTTP.new(ENV["TIMBER"]) : STDOUT
logger = Timber::Logger.new(log_device)
logger.level = config.log_level
config.logger = ActiveSupport::TaggedLogging.new(logger)

View file

@ -8,7 +8,7 @@ Rails.application.routes.draw do
}
if Rails.env.development?
match "/delayed_job" => DelayedJobWeb, :anchor => false, :via => [:get, :post]
match "/delayed_job" => DelayedJobWeb, :anchor => false, :via => %i[get post]
end
devise_scope :user do

View file

@ -29,5 +29,4 @@ RSpec.describe "OrganizationsUpdate", type: :request do
put "/organizations/#{organization.id}", params: { organization: { text_color_hex: "#111111" } }
expect(organization.reload.profile_updated_at).to be > 2.minutes.ago
end
end

View file

@ -11,6 +11,7 @@ RSpec.describe "StripeCancellations", type: :request do
after { StripeMock.stop }
# rubocop:disable RSpec/ExampleLength
it "mocks a stripe cancellation webhook" do
customer = Stripe::Customer.create(
email: user.email,
@ -29,4 +30,5 @@ RSpec.describe "StripeCancellations", type: :request do
expect(user.monthly_dues).to eq(0)
expect(response).to have_http_status(200)
end
# rubocop:enable RSpec/ExampleLength
end