From fda09248da59a3f9da1401992b80bc8be8a634e0 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Thu, 28 Nov 2024 17:13:04 +0100 Subject: [PATCH] Add tests for trips controller and change map seach form --- app/views/map/index.html.erb | 14 +- app/views/shared/_right_sidebar.html.erb | 2 +- app/views/trips/show.html.erb | 8 +- spec/factories/trips.rb | 22 ++- spec/requests/trips_spec.rb | 143 +++++++++++--------- spec/services/immich/request_photos_spec.rb | 4 +- 6 files changed, 111 insertions(+), 82 deletions(-) diff --git a/app/views/map/index.html.erb b/app/views/map/index.html.erb index dd1a0d17..8f6bbb14 100644 --- a/app/views/map/index.html.erb +++ b/app/views/map/index.html.erb @@ -8,33 +8,35 @@
<%= f.label :start_at, class: "text-sm font-semibold" %> - <%= f.datetime_local_field :start_at, class: "rounded-md w-full", value: @start_at %> + <%= f.datetime_local_field :start_at, class: "input input-bordered hover:cursor-pointer hover:input-primary", value: @start_at %>
<%= f.label :end_at, class: "text-sm font-semibold" %> - <%= f.datetime_local_field :end_at, class: "rounded-md w-full", value: @end_at %> + <%= f.datetime_local_field :end_at, class: "input input-bordered hover:cursor-pointer hover:input-primary", value: @end_at %>
- <%= f.submit "Search", class: "px-4 py-2 bg-blue-500 text-white rounded-md" %> + <%= f.submit "Search", class: "btn btn-primary hover:btn-info" %>
- <%= link_to "Yesterday", map_path(start_at: Date.yesterday.beginning_of_day, end_at: Date.yesterday.end_of_day, import_id: params[:import_id]), class: "px-4 py-2 bg-gray-500 text-white rounded-md" %> + <%= link_to "Yesterday", + map_path(start_at: Date.yesterday.beginning_of_day, end_at: Date.yesterday.end_of_day, import_id: params[:import_id]), + class: "btn btn-neutral hover:btn-ghost" %>
- <%= link_to "Last 7 days", map_path(start_at: 1.week.ago.beginning_of_day, end_at: Time.current.end_of_day, import_id: params[:import_id]), class: "px-4 py-2 bg-gray-500 text-white rounded-md" %> + <%= link_to "Last 7 days", map_path(start_at: 1.week.ago.beginning_of_day, end_at: Time.current.end_of_day, import_id: params[:import_id]), class: "btn btn-neutral hover:btn-ghost" %>
- <%= link_to "Last month", map_path(start_at: 1.month.ago.beginning_of_day, end_at: Time.current.end_of_day, import_id: params[:import_id]), class: "px-4 py-2 bg-gray-500 text-white rounded-md" %> + <%= link_to "Last month", map_path(start_at: 1.month.ago.beginning_of_day, end_at: Time.current.end_of_day, import_id: params[:import_id]), class: "btn btn-neutral hover:btn-ghost" %>
diff --git a/app/views/shared/_right_sidebar.html.erb b/app/views/shared/_right_sidebar.html.erb index d00017fb..87c99c04 100644 --- a/app/views/shared/_right_sidebar.html.erb +++ b/app/views/shared/_right_sidebar.html.erb @@ -2,7 +2,7 @@