Commit ef4a84ba443cf8f63a6ea0d63dd7b03187eb46f3
1 parent
a8f3a260
Exists in
colab
and in
4 other branches
Process times are comming in seconds now
Showing
3 changed files
with
4 additions
and
4 deletions
Show diff stats
.travis.yml
| ... | ... | @@ -24,7 +24,7 @@ before_script: |
| 24 | 24 | - cd .. |
| 25 | 25 | - export BUNDLE_GEMFILE=$PWD/Gemfile |
| 26 | 26 | # Processor |
| 27 | - - git clone https://github.com/mezuro/kalibro_processor.git -b v0.0.2 kalibro_processor | |
| 27 | + - git clone https://github.com/mezuro/kalibro_processor.git -b v0.0.4 kalibro_processor | |
| 28 | 28 | - cd kalibro_processor |
| 29 | 29 | - psql -c "create role kalibro_processor with createdb login password 'kalibro_processor'" -U postgres |
| 30 | 30 | - cp config/database.yml.postgresql_sample config/database.yml | ... | ... |
app/helpers/processings_helper.rb
| 1 | 1 | module ProcessingsHelper |
| 2 | - def humanize_eplased_time duration_in_milliseconds | |
| 3 | - distance_of_time_in_words(Time.now, (duration_in_milliseconds/1000.0).seconds.from_now) | |
| 2 | + def humanize_eplased_time duration_in_seconds | |
| 3 | + distance_of_time_in_words(Time.now, duration_in_seconds.seconds.from_now) | |
| 4 | 4 | end |
| 5 | 5 | |
| 6 | 6 | def format_grade(grade) | ... | ... |
spec/helpers/processings_helper_spec.rb
| ... | ... | @@ -3,7 +3,7 @@ require 'spec_helper' |
| 3 | 3 | describe ProcessingsHelper, :type => :helper do |
| 4 | 4 | describe 'humanize_eplased_time' do |
| 5 | 5 | it 'should convert it to readable words' do |
| 6 | - expect(helper.humanize_eplased_time(6000)).to eq('less than a minute') | |
| 6 | + expect(helper.humanize_eplased_time(6)).to eq('less than a minute') | |
| 7 | 7 | end |
| 8 | 8 | end |
| 9 | 9 | ... | ... |