Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/views/activities/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@
<tr>
<th scope="row"><%= order.id %>
</th>
<td><%= l order.created_at, format: :time_only %></td>
<td><%= l order.created_at, format: :with_year %></td>
<td>
<% if order.user.present? %>
<%= link_to order.user.name, order.user %>
Expand Down
24 changes: 24 additions & 0 deletions spec/controllers/activities_controller/show_spec.rb
Original file line number Diff line number Diff line change
@@ -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