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