aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2014-12-23 07:13:54 -0700
committerSean Griffin <sean@thoughtbot.com>2014-12-23 07:13:54 -0700
commita054269ff8a3589784e25729359f71d0838b5d3e (patch)
tree84219728baa43c39b7192eb8ffea04c001a7c456 /activerecord/test
parentb5bfd6fe521dc2d3bf6ad1046905ea9751488f2d (diff)
parentd318badc269358c53d9dfb4000e8c4c21a94b578 (diff)
downloadrails-a054269ff8a3589784e25729359f71d0838b5d3e.tar.gz
rails-a054269ff8a3589784e25729359f71d0838b5d3e.tar.bz2
rails-a054269ff8a3589784e25729359f71d0838b5d3e.zip
Merge Pull Request #18157
Conflicts: activerecord/CHANGELOG.md
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/date_time_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/cases/date_time_test.rb b/activerecord/test/cases/date_time_test.rb
index c0491bbee5..c2ec92c40d 100644
--- a/activerecord/test/cases/date_time_test.rb
+++ b/activerecord/test/cases/date_time_test.rb
@@ -3,6 +3,8 @@ require 'models/topic'
require 'models/task'
class DateTimeTest < ActiveRecord::TestCase
+ include InTimeZone
+
def test_saves_both_date_and_time
with_env_tz 'America/New_York' do
with_timezone_config default: :utc do
@@ -29,6 +31,14 @@ class DateTimeTest < ActiveRecord::TestCase
assert_nil task.ending
end
+ def test_assign_bad_date_time_with_timezone
+ in_time_zone "Pacific Time (US & Canada)" do
+ task = Task.new
+ task.starting = '2014-07-01T24:59:59GMT'
+ assert_nil task.starting
+ end
+ end
+
def test_assign_empty_date
topic = Topic.new
topic.last_read = ''