Sha256: a90c391774b7149589a9308a7773d6dbaf1f3fe3af0bd6f16ec03f2e50848e34
Contents?: true
Size: 881 Bytes
Versions: 22
Compression:
Stored size: 881 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 has_options? true end def link nil end def initialize(params) self.time_zone_column = params[:time_zone_column] end end end end
Version data entries
22 entries across 22 versions & 1 rubygems