Commit ef4a84ba443cf8f63a6ea0d63dd7b03187eb46f3

Authored by Rafael Manzo
1 parent a8f3a260

Process times are comming in seconds now

@@ -24,7 +24,7 @@ before_script: @@ -24,7 +24,7 @@ before_script:
24 - cd .. 24 - cd ..
25 - export BUNDLE_GEMFILE=$PWD/Gemfile 25 - export BUNDLE_GEMFILE=$PWD/Gemfile
26 # Processor 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 - cd kalibro_processor 28 - cd kalibro_processor
29 - psql -c "create role kalibro_processor with createdb login password 'kalibro_processor'" -U postgres 29 - psql -c "create role kalibro_processor with createdb login password 'kalibro_processor'" -U postgres
30 - cp config/database.yml.postgresql_sample config/database.yml 30 - cp config/database.yml.postgresql_sample config/database.yml
app/helpers/processings_helper.rb
1 module ProcessingsHelper 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 end 4 end
5 5
6 def format_grade(grade) 6 def format_grade(grade)
spec/helpers/processings_helper_spec.rb
@@ -3,7 +3,7 @@ require 'spec_helper' @@ -3,7 +3,7 @@ require 'spec_helper'
3 describe ProcessingsHelper, :type => :helper do 3 describe ProcessingsHelper, :type => :helper do
4 describe 'humanize_eplased_time' do 4 describe 'humanize_eplased_time' do
5 it 'should convert it to readable words' do 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 end 7 end
8 end 8 end
9 9