diff --git a/app/services/users/import_data/points.rb b/app/services/users/import_data/points.rb index 2d27b8ee..0ed04818 100644 --- a/app/services/users/import_data/points.rb +++ b/app/services/users/import_data/points.rb @@ -219,9 +219,7 @@ class Users::ImportData::Points country_key = [country_info['name'], country_info['iso_a2'], country_info['iso_a3']] country = countries_lookup[country_key] - if country.nil? && country_info['name'].present? - country = countries_lookup[country_info['name']] - end + country = countries_lookup[country_info['name']] if country.nil? && country_info['name'].present? if country attributes['country_id'] = country.id @@ -254,12 +252,12 @@ class Users::ImportData::Points end def ensure_lonlat_field(attributes, point_data) - if attributes['lonlat'].blank? && point_data['longitude'].present? && point_data['latitude'].present? - longitude = point_data['longitude'].to_f - latitude = point_data['latitude'].to_f - attributes['lonlat'] = "POINT(#{longitude} #{latitude})" - logger.debug "Reconstructed lonlat: #{attributes['lonlat']}" - end + 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 + attributes['lonlat'] = "POINT(#{longitude} #{latitude})" + logger.debug "Reconstructed lonlat: #{attributes['lonlat']}" end def normalize_timestamp_for_lookup(timestamp) diff --git a/app/views/users/digests/public_year.html.erb b/app/views/users/digests/public_year.html.erb index a2cfaec7..ec07863b 100644 --- a/app/views/users/digests/public_year.html.erb +++ b/app/views/users/digests/public_year.html.erb @@ -4,7 +4,7 @@

<%= @digest.year %> Year in Review

-

A journey, by the numbers

+

Your journey, by the numbers

diff --git a/config/application.rb b/config/application.rb index e6949ead..55864862 100644 --- a/config/application.rb +++ b/config/application.rb @@ -38,7 +38,5 @@ module Dawarich config.active_job.queue_adapter = :sidekiq config.action_mailer.preview_paths << Rails.root.join('spec/mailers/previews').to_s - - config.middleware.use Rack::Deflater end end diff --git a/spec/views/devise/shared/_links.html.erb_spec.rb b/spec/views/devise/shared/_links.html.erb_spec.rb deleted file mode 100644 index 6972747b..00000000 --- a/spec/views/devise/shared/_links.html.erb_spec.rb +++ /dev/null @@ -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