Commit ebdd98c33bb59b2a0c037be065114d9f7f4400b8
1 parent
335629fd
Exists in
colab
and in
4 other branches
Processing date, and durations are now human readable
Showing
4 changed files
with
17 additions
and
3 deletions
Show diff stats
app/views/repositories/show.html.erb
... | ... | @@ -23,15 +23,15 @@ |
23 | 23 | </p> |
24 | 24 | |
25 | 25 | <p> |
26 | - <strong>Date:</strong> | |
27 | - <%= @processing.date %> | |
26 | + <strong>Creation date:</strong> | |
27 | + <%= @processing.date.strftime("%Y/%m/%d at %Hh%M (%z)") %> | |
28 | 28 | </p> |
29 | 29 | |
30 | 30 | <% unless @processing.process_times.nil? %> |
31 | 31 | <% @processing.process_times.each do |process_time| %> |
32 | 32 | <p> |
33 | 33 | <strong><%= process_time.state %> time:</strong> |
34 | - <%= process_time.time %> | |
34 | + <%= humanize_eplased_time(process_time.time) %> | |
35 | 35 | </p> |
36 | 36 | <% end %> |
37 | 37 | <% end %> | ... | ... |
spec/helpers/.keep
... | ... | @@ -0,0 +1,9 @@ |
1 | +require 'spec_helper' | |
2 | + | |
3 | +describe ProcessingsHelper do | |
4 | + describe 'humanize_eplased_time' do | |
5 | + it 'should convert it to readable words' do | |
6 | + helper.humanize_eplased_time(6000).should eq('less than a minute') | |
7 | + end | |
8 | + end | |
9 | +end | |
0 | 10 | \ No newline at end of file | ... | ... |