mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -05:00
Update rubocop issues
This commit is contained in:
parent
2f5487cd35
commit
7f277612fc
4 changed files with 8 additions and 62 deletions
|
|
@ -219,9 +219,7 @@ class Users::ImportData::Points
|
||||||
country_key = [country_info['name'], country_info['iso_a2'], country_info['iso_a3']]
|
country_key = [country_info['name'], country_info['iso_a2'], country_info['iso_a3']]
|
||||||
country = countries_lookup[country_key]
|
country = countries_lookup[country_key]
|
||||||
|
|
||||||
if country.nil? && country_info['name'].present?
|
country = countries_lookup[country_info['name']] if country.nil? && country_info['name'].present?
|
||||||
country = countries_lookup[country_info['name']]
|
|
||||||
end
|
|
||||||
|
|
||||||
if country
|
if country
|
||||||
attributes['country_id'] = country.id
|
attributes['country_id'] = country.id
|
||||||
|
|
@ -254,12 +252,12 @@ class Users::ImportData::Points
|
||||||
end
|
end
|
||||||
|
|
||||||
def ensure_lonlat_field(attributes, point_data)
|
def ensure_lonlat_field(attributes, point_data)
|
||||||
if attributes['lonlat'].blank? && point_data['longitude'].present? && point_data['latitude'].present?
|
return unless attributes['lonlat'].blank? && point_data['longitude'].present? && point_data['latitude'].present?
|
||||||
longitude = point_data['longitude'].to_f
|
|
||||||
latitude = point_data['latitude'].to_f
|
longitude = point_data['longitude'].to_f
|
||||||
attributes['lonlat'] = "POINT(#{longitude} #{latitude})"
|
latitude = point_data['latitude'].to_f
|
||||||
logger.debug "Reconstructed lonlat: #{attributes['lonlat']}"
|
attributes['lonlat'] = "POINT(#{longitude} #{latitude})"
|
||||||
end
|
logger.debug "Reconstructed lonlat: #{attributes['lonlat']}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def normalize_timestamp_for_lookup(timestamp)
|
def normalize_timestamp_for_lookup(timestamp)
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
<div class="hero-content text-center py-12">
|
<div class="hero-content text-center py-12">
|
||||||
<div class="max-w-lg">
|
<div class="max-w-lg">
|
||||||
<h1 class="text-4xl font-bold"><%= @digest.year %> Year in Review</h1>
|
<h1 class="text-4xl font-bold"><%= @digest.year %> Year in Review</h1>
|
||||||
<p class="py-4">A journey, by the numbers</p>
|
<p class="py-4">Your journey, by the numbers</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,5 @@ module Dawarich
|
||||||
config.active_job.queue_adapter = :sidekiq
|
config.active_job.queue_adapter = :sidekiq
|
||||||
|
|
||||||
config.action_mailer.preview_paths << Rails.root.join('spec/mailers/previews').to_s
|
config.action_mailer.preview_paths << Rails.root.join('spec/mailers/previews').to_s
|
||||||
|
|
||||||
config.middleware.use Rack::Deflater
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,50 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
require 'rails_helper'
|
|
||||||
|
|
||||||
RSpec.describe 'devise/shared/_links.html.erb', type: :view do
|
|
||||||
let(:resource_name) { :user }
|
|
||||||
let(:devise_mapping) { Devise.mappings[:user] }
|
|
||||||
|
|
||||||
before do
|
|
||||||
def view.resource_name
|
|
||||||
:user
|
|
||||||
end
|
|
||||||
|
|
||||||
def view.devise_mapping
|
|
||||||
Devise.mappings[:user]
|
|
||||||
end
|
|
||||||
|
|
||||||
def view.resource_class
|
|
||||||
User
|
|
||||||
end
|
|
||||||
|
|
||||||
def view.signed_in?
|
|
||||||
false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'with OIDC provider' do
|
|
||||||
before do
|
|
||||||
stub_const('OMNIAUTH_PROVIDERS', [:openid_connect])
|
|
||||||
allow(User).to receive(:omniauth_providers).and_return([:openid_connect])
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'displays custom OIDC provider name' do
|
|
||||||
stub_const('OIDC_PROVIDER_NAME', 'Authentik')
|
|
||||||
|
|
||||||
render
|
|
||||||
|
|
||||||
expect(rendered).to have_button('Sign in with Authentik')
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'displays default name when OIDC_PROVIDER_NAME is not set' do
|
|
||||||
stub_const('OIDC_PROVIDER_NAME', 'Openid Connect')
|
|
||||||
|
|
||||||
render
|
|
||||||
|
|
||||||
expect(rendered).to have_button('Sign in with Openid Connect')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
Loading…
Reference in a new issue