diff --git a/CHANGELOG.md b/CHANGELOG.md
index 93771c6f..6bdd02d1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,7 +19,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Notification about Photon API load is now disabled.
- All distance values are now stored in the database in meters. Conversion to user's preferred unit is done on the fly.
- Every night, Dawarich will try to fetch names for places and visits that don't have them. #1281 #902 #583 #212
-- User settings are now being serialized in a more consistent way. `GET /api/v1/users/me` now returns the following data structure:
+- ⚠️ User settings are now being serialized in a more consistent way ⚠. `GET /api/v1/users/me` now returns the following data structure:
```json
{
"user": {
diff --git a/app/services/visits/suggest.rb b/app/services/visits/suggest.rb
index 39f0ef11..7aab6b93 100644
--- a/app/services/visits/suggest.rb
+++ b/app/services/visits/suggest.rb
@@ -1,8 +1,6 @@
# frozen_string_literal: true
class Visits::Suggest
- include Rails.application.routes.url_helpers
-
attr_reader :points, :user, :start_at, :end_at
def initialize(user, start_at:, end_at:)
@@ -14,6 +12,7 @@ class Visits::Suggest
def call
visits = Visits::SmartDetect.new(user, start_at:, end_at:).call
+
create_visits_notification(user) if visits.any?
return nil unless DawarichSettings.reverse_geocoding_enabled?
@@ -35,7 +34,7 @@ class Visits::Suggest
def create_visits_notification(user)
content = <<~CONTENT
- New visits have been suggested based on your location data from #{Time.zone.at(start_at)} to #{Time.zone.at(end_at)}. You can review them on the Visits page.
+ New visits have been suggested based on your location data from #{Time.zone.at(start_at)} to #{Time.zone.at(end_at)}. You can review them on the Visits page.
CONTENT
user.notifications.create!(
diff --git a/spec/services/users/safe_settings_spec.rb b/spec/services/users/safe_settings_spec.rb
index 11079920..573009c9 100644
--- a/spec/services/users/safe_settings_spec.rb
+++ b/spec/services/users/safe_settings_spec.rb
@@ -27,7 +27,9 @@ RSpec.describe Users::SafeSettings do
photoprism_api_key: nil,
maps: { "distance_unit" => "km" },
distance_unit: 'km',
- visits_suggestions_enabled: true
+ visits_suggestions_enabled: true,
+ speed_color_scale: nil,
+ fog_of_war_threshold: nil
}
)
end
@@ -98,7 +100,9 @@ RSpec.describe Users::SafeSettings do
photoprism_api_key: "photoprism-key",
maps: { "name" => "custom", "url" => "https://custom.example.com" },
distance_unit: nil,
- visits_suggestions_enabled: false
+ visits_suggestions_enabled: false,
+ speed_color_scale: nil,
+ fog_of_war_threshold: nil
}
)
end
diff --git a/spec/services/visits/suggest_spec.rb b/spec/services/visits/suggest_spec.rb
index 167b9ba9..be56338c 100644
--- a/spec/services/visits/suggest_spec.rb
+++ b/spec/services/visits/suggest_spec.rb
@@ -81,7 +81,7 @@ RSpec.describe Visits::Suggest do
before do
allow(DawarichSettings).to receive(:reverse_geocoding_enabled?).and_return(true)
- # Create points for reverse geocoding test in a separate time range
+
create_visit_points(user, reverse_geocoding_start_at)
clear_enqueued_jobs
end
diff --git a/spec/swagger/api/v1/users_controller_spec.rb b/spec/swagger/api/v1/users_controller_spec.rb
index 753f4f08..73ad274d 100644
--- a/spec/swagger/api/v1/users_controller_spec.rb
+++ b/spec/swagger/api/v1/users_controller_spec.rb
@@ -29,19 +29,22 @@ describe 'Users API', type: :request do
settings: {
type: :object,
properties: {
- immich_url: { type: :string },
- route_opacity: { type: :string },
- immich_api_key: { type: :string },
- live_map_enabled: { type: :boolean },
- fog_of_war_meters: { type: :string },
+ maps: { type: :object },
+ fog_of_war_meters: { type: :integer },
+ meters_between_routes: { type: :integer },
preferred_map_layer: { type: :string },
speed_colored_routes: { type: :boolean },
- meters_between_routes: { type: :string },
points_rendering_mode: { type: :string },
- minutes_between_routes: { type: :string },
- time_threshold_minutes: { type: :string },
- merge_threshold_minutes: { type: :string },
- speed_colored_polylines: { type: :boolean }
+ minutes_between_routes: { type: :integer },
+ time_threshold_minutes: { type: :integer },
+ merge_threshold_minutes: { type: :integer },
+ live_map_enabled: { type: :boolean },
+ route_opacity: { type: :number },
+ immich_url: { type: :string, nullable: true },
+ photoprism_url: { type: :string, nullable: true },
+ visits_suggestions_enabled: { type: :boolean },
+ speed_color_scale: { type: :string, nullable: true },
+ fog_of_war_threshold: { type: :string, nullable: true }
}
},
admin: { type: :boolean }
diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb
deleted file mode 100644
index d19212ab..00000000
--- a/test/application_system_test_case.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-require "test_helper"
-
-class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
- driven_by :selenium, using: :chrome, screen_size: [1400, 1400]
-end
diff --git a/test/channels/application_cable/connection_test.rb b/test/channels/application_cable/connection_test.rb
deleted file mode 100644
index 800405f1..00000000
--- a/test/channels/application_cable/connection_test.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-require "test_helper"
-
-class ApplicationCable::ConnectionTest < ActionCable::Connection::TestCase
- # test "connects with cookies" do
- # cookies.signed[:user_id] = 42
- #
- # connect
- #
- # assert_equal connection.user_id, "42"
- # end
-end
diff --git a/test/controllers/.keep b/test/controllers/.keep
deleted file mode 100644
index e69de29b..00000000
diff --git a/test/fixtures/files/.keep b/test/fixtures/files/.keep
deleted file mode 100644
index e69de29b..00000000
diff --git a/test/helpers/.keep b/test/helpers/.keep
deleted file mode 100644
index e69de29b..00000000
diff --git a/test/integration/.keep b/test/integration/.keep
deleted file mode 100644
index e69de29b..00000000
diff --git a/test/mailers/.keep b/test/mailers/.keep
deleted file mode 100644
index e69de29b..00000000
diff --git a/test/models/.keep b/test/models/.keep
deleted file mode 100644
index e69de29b..00000000
diff --git a/test/system/.keep b/test/system/.keep
deleted file mode 100644
index e69de29b..00000000
diff --git a/test/test_helper.rb b/test/test_helper.rb
deleted file mode 100644
index d713e377..00000000
--- a/test/test_helper.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-ENV["RAILS_ENV"] ||= "test"
-require_relative "../config/environment"
-require "rails/test_help"
-
-class ActiveSupport::TestCase
- # Run tests in parallel with specified workers
- parallelize(workers: :number_of_processors)
-
- # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
- fixtures :all
-
- # Add more helper methods to be used by all tests here...
-end