From 2c6a9f4ee80676444fd886727f9f54c2235258a8 Mon Sep 17 00:00:00 2001 From: jay23606 <4602056+jay23606@users.noreply.github.com> Date: Fri, 20 Nov 2026 07:45:54 -0500 Subject: [PATCH] Show order date in activity orders list Co-Authored-By: Claude Haiku 5.5 --- app/views/activities/show.html.erb | 2 +- .../activities_controller/show_spec.rb | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) 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 3b8fdba76..2148b3eac 100644 --- a/app/views/activities/show.html.erb +++ b/app/views/activities/show.html.erb @@ -306,7 +306,7 @@ <%= order.id %> - <%= 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..4fdfdf5ff --- /dev/null +++ b/spec/controllers/activities_controller/show_spec.rb @@ -0,0 +1,24 @@ +require 'rails_helper' + +describe ActivitiesController do + describe 'GET show' do + render_views + + let(:activity) { create(:activity) } + let(:order_time) { Time.zone.local(2024, 3, 5, 14, 30) } + let!(:order) { create(:order, activity:, created_at: order_time) } + + 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 + get :show, params: { id: activity.id } + + expect(response.status).to eq 200 + expect(response.body).to include('05-03-24 14:30') + end + end + end +end