Sha256: a478be55e95117c8986e4fa492c249c5e6f75aacb9158729137d98ce3f8b9a7f

Contents?: true

Size: 1.02 KB

Versions: 14

Compression:

Stored size: 1.02 KB

Contents

require 'spec_helper'
require 'resque-history/helpers/helper'

describe Resque::History::Helper do

  include  Resque::History::Helper

  it "should show correct number of seconds" do
    format_execution(40).should == "40 secs"
  end

  it "should show correct number of minutes" do
    format_execution(600).should == "10 minutes"
    format_execution(659).should == "10 minutes"
    format_execution(660).should == "11 minutes"
  end

  it "should show correct number of hours" do
    format_execution(3600).should == "1.0 hours"
    format_execution(7200).should == "2.0 hours"
    format_execution(5400).should == "1.5 hours"
    format_execution(5403).should == "1.5 hours"
    format_execution(5703).should == "1.58 hours"
  end

  it "should show correct number of days" do
    format_execution(86400).should == "1.0 days"
    format_execution(129600).should == "1.5 days"
    format_execution(518400).should == "6.0 days"
  end

  it "should show that job is too long" do
    format_execution(604800).should == "too long"
  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
resque-history-1.12.3 spec/resque-history/resque_history_helper_spec.rb
resque-history-1.12.2 spec/resque-history/resque_history_helper_spec.rb
resque-history-1.12.1 spec/resque-history/resque_history_helper_spec.rb
resque-history-1.12.0 spec/resque-history/resque_history_helper_spec.rb
resque-history-1.11.1 spec/resque-history/resque_history_helper_spec.rb
resque-history-1.11.0 spec/resque-history/resque_history_helper_spec.rb
resque-history-1.10.0 spec/resque-history/resque_history_helper_spec.rb
resque-history-1.9.5 spec/resque-history/resque_history_helper_spec.rb
resque-history-1.9.4 spec/resque-history/resque_history_helper_spec.rb
resque-history-1.9.3 spec/resque-history/resque_history_helper_spec.rb
resque-history-1.9.2 spec/resque-history/resque_history_helper_spec.rb
resque-history-1.9.1 spec/resque-history/resque_history_helper_spec.rb
resque-history-1.9.0 spec/resque-history/resque_history_helper_spec.rb
resque-history-1.8.2 spec/resque-history/resque_history_helper_spec.rb