Sha256: e4e71851b1b7f4ad8d93392943117287f450a15affdab3ec3c6eb7f5f5c0174b

Contents?: true

Size: 783 Bytes

Versions: 16

Compression:

Stored size: 783 Bytes

Contents

require 'test_helper'

module ClarkKent
  class ReportsHelperTest < ActionView::TestCase
    include ClarkKent::ApplicationHelper
    test "it displays a date" do
      tz = "Mountain Time (US & Canada)"
      now = Time.now
      now = now.in_time_zone(tz)
      col = FakeReportColumn.new(time_zone_column: :time_zone)
      datetime_display = display_for_value(
        now,
        col,
        {time_zone: "Pacific Time (US & Canada)"})
      now.time_zone.name.must_equal "Mountain Time (US & Canada)"
      datetime_display.must_equal now.in_time_zone("Pacific Time (US & Canada)").to_s
    end

    class FakeReportColumn
      attr_accessor :time_zone_column
      def initialize(params)
        self.time_zone_column = params[:time_zone_column]
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
clark_kent-0.8.6 test/helpers/clark_kent/reports_helper_test.rb
clark_kent-0.8.5 test/helpers/clark_kent/reports_helper_test.rb
clark_kent-0.8.4 test/helpers/clark_kent/reports_helper_test.rb
clark_kent-0.8.3 test/helpers/clark_kent/reports_helper_test.rb
clark_kent-0.8.2 test/helpers/clark_kent/reports_helper_test.rb
clark_kent-0.8.1 test/helpers/clark_kent/reports_helper_test.rb
clark_kent-0.7.1 test/helpers/clark_kent/reports_helper_test.rb
clark_kent-0.7.0 test/helpers/clark_kent/reports_helper_test.rb
clark_kent-0.6.1 test/helpers/clark_kent/reports_helper_test.rb
clark_kent-0.6.0 test/helpers/clark_kent/reports_helper_test.rb
clark_kent-0.5.0 test/helpers/clark_kent/reports_helper_test.rb
clark_kent-0.4.4 test/helpers/clark_kent/reports_helper_test.rb
clark_kent-0.4.3 test/helpers/clark_kent/reports_helper_test.rb
clark_kent-0.4.2 test/helpers/clark_kent/reports_helper_test.rb
clark_kent-0.4.1 test/helpers/clark_kent/reports_helper_test.rb
clark_kent-0.4.0 test/helpers/clark_kent/reports_helper_test.rb