Sha256: 5124e300b1a3afb692cc1dbad7b1d5fc9c2c3097557fa5537c8f3d55e92919bd

Contents?: true

Size: 873 Bytes

Versions: 1

Compression:

Stored size: 873 Bytes

Contents

require "spec_helper"

class ViewHelper
  include Vidibus::Helpers::Extensions::View
end

describe ViewHelper do
  describe "#number_to_duration" do
    it "should return 00:24 for 24 seconds" do
      subject.number_to_duration(24).should eql("00:24")
    end

    it "should return 00:00:24 for 24 seconds if :hours option is true" do
      subject.number_to_duration(24, :hours => true).should eql("00:00:24")
    end

    it "should return 01:00:54 for 3654 seconds" do
      subject.number_to_duration(3654, :hours => true).should eql("01:00:54")
    end

    it "should return 01:00:55 for 3654.5 seconds" do
      subject.number_to_duration(3654.5, :hours => true).should eql("01:00:55")
    end

    it "should return 60:54 for 3654 seconds if :hours option is false" do
      subject.number_to_duration(3654, :hours => false).should eql("60:54")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vidibus-helpers-0.0.1 spec/vidibus/helpers/extensions/view_spec.rb