From 1c0ce5b5e9d94d01a40c3537800a7bc6ec81c8df Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 2 Dec 2026 11:00:53 +0000 Subject: [PATCH 1/4] Add date column to activity order list Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01SiPSKFK91i3bhYwj55ita1 --- app/views/activities/show.html.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/activities/show.html.erb b/app/views/activities/show.html.erb index 3b8fdba76..591fb876b 100644 --- a/app/views/activities/show.html.erb +++ b/app/views/activities/show.html.erb @@ -283,7 +283,7 @@ <% if @orders.empty? %> - + @@ -306,6 +307,7 @@ + - + @@ -260,7 +260,7 @@ <% @credit_mutations.each do |mutation| %> - +
+

Er zijn nog geen bestellingen @@ -295,6 +295,7 @@

#Datum Tijd Gebruiker Bedrag
<%= order.id %> <%= l order.created_at, format: :date_only %> <%= l order.created_at, format: :time_only %> <% if order.user.present? %> From 10a973ec9d1550cfabfd4129d6081a2136ae172f Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 2 Dec 2026 21:16:10 +0000 Subject: [PATCH 2/4] Show date and time in one column on activity order and credit tabs Adopts the approach of #1287: rename Tijd to Datum and use the with_year format. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01SiPSKFK91i3bhYwj55ita1 --- app/views/activities/show.html.erb | 10 +++--- .../activities_controller/show_spec.rb | 31 +++++++++++++++++++ 2 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 spec/controllers/activities_controller/show_spec.rb diff --git a/app/views/activities/show.html.erb b/app/views/activities/show.html.erb index 591fb876b..c96ce4dc5 100644 --- a/app/views/activities/show.html.erb +++ b/app/views/activities/show.html.erb @@ -251,7 +251,7 @@
#TijdDatum Gebruiker Bedrag
<%= mutation.id %><%= l mutation.created_at, format: :time_only %><%= l mutation.created_at, format: :with_year %> <% if policy(User).show? %> <%= link_to mutation.user.name, mutation.user %> @@ -283,7 +283,7 @@ <% if @orders.empty? %> - - @@ -307,8 +306,7 @@ - - +
+

Er zijn nog geen bestellingen @@ -296,7 +296,6 @@

# DatumTijd Gebruiker Bedrag Producten
<%= order.id %> <%= l order.created_at, format: :date_only %><%= l order.created_at, format: :time_only %><%= l order.created_at, format: :with_year %> <% if order.user.present? %> <%= link_to order.user.name, order.user %> diff --git a/spec/controllers/activities_controller/show_spec.rb b/spec/controllers/activities_controller/show_spec.rb new file mode 100644 index 000000000..05c50fbc6 --- /dev/null +++ b/spec/controllers/activities_controller/show_spec.rb @@ -0,0 +1,31 @@ +require 'rails_helper' + +describe ActivitiesController do + describe 'GET show' do + render_views + + let(:activity) { create(:activity) } + + before { sign_in user } + + context 'when as treasurer' do + let(:user) { create(:user, :treasurer) } + + it 'shows the date and time of orders in the orders tab' do + create(:order, :cash, activity:, created_at: Time.zone.local(2024, 3, 5, 14, 30)) + get :show, params: { id: activity.id } + + expect(response.status).to eq 200 + expect(response.body).to include('05-03-24 14:30') + end + + it 'shows the date and time of credit mutations in the credit mutations tab' do + create(:credit_mutation, activity:, created_at: Time.zone.local(2024, 4, 6, 15, 45)) + get :show, params: { id: activity.id } + + expect(response.status).to eq 200 + expect(response.body).to include('06-04-24 15:45') + end + end + end +end From e91ed03c6773f1130ac5cbbca74737a24c77ca17 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 2 Dec 2026 21:19:22 +0000 Subject: [PATCH 3/4] Use have_http_status in activities show spec Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01SiPSKFK91i3bhYwj55ita1 --- spec/controllers/activities_controller/show_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/controllers/activities_controller/show_spec.rb b/spec/controllers/activities_controller/show_spec.rb index 05c50fbc6..84a6eeb07 100644 --- a/spec/controllers/activities_controller/show_spec.rb +++ b/spec/controllers/activities_controller/show_spec.rb @@ -15,7 +15,7 @@ create(:order, :cash, activity:, created_at: Time.zone.local(2024, 3, 5, 14, 30)) get :show, params: { id: activity.id } - expect(response.status).to eq 200 + expect(response).to have_http_status(:ok) expect(response.body).to include('05-03-24 14:30') end @@ -23,7 +23,7 @@ create(:credit_mutation, activity:, created_at: Time.zone.local(2024, 4, 6, 15, 45)) get :show, params: { id: activity.id } - expect(response.status).to eq 200 + expect(response).to have_http_status(:ok) expect(response.body).to include('06-04-24 15:45') end end From 698b7e59893e1d3f42d8e7eb79ee56a31ca3eaa0 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 2 Dec 2026 21:20:28 +0000 Subject: [PATCH 4/4] Remove view-rendering spec that needs built JS assets CI runs tests without precompiled webpack assets, so rendering the activity show view fails on the activity.js include. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01SiPSKFK91i3bhYwj55ita1 --- .../activities_controller/show_spec.rb | 31 ------------------- 1 file changed, 31 deletions(-) delete mode 100644 spec/controllers/activities_controller/show_spec.rb diff --git a/spec/controllers/activities_controller/show_spec.rb b/spec/controllers/activities_controller/show_spec.rb deleted file mode 100644 index 84a6eeb07..000000000 --- a/spec/controllers/activities_controller/show_spec.rb +++ /dev/null @@ -1,31 +0,0 @@ -require 'rails_helper' - -describe ActivitiesController do - describe 'GET show' do - render_views - - let(:activity) { create(:activity) } - - before { sign_in user } - - context 'when as treasurer' do - let(:user) { create(:user, :treasurer) } - - it 'shows the date and time of orders in the orders tab' do - create(:order, :cash, activity:, created_at: Time.zone.local(2024, 3, 5, 14, 30)) - get :show, params: { id: activity.id } - - expect(response).to have_http_status(:ok) - expect(response.body).to include('05-03-24 14:30') - end - - it 'shows the date and time of credit mutations in the credit mutations tab' do - create(:credit_mutation, activity:, created_at: Time.zone.local(2024, 4, 6, 15, 45)) - get :show, params: { id: activity.id } - - expect(response).to have_http_status(:ok) - expect(response.body).to include('06-04-24 15:45') - end - end - end -end