test/test_model.rb in couchbase-model-0.1.0 vs test/test_model.rb in couchbase-model-0.2.0
- old
+ new
@@ -19,11 +19,11 @@
class Post < Couchbase::Model
attribute :title
attribute :body
attribute :author, :default => 'Anonymous'
- attribute :created_at, :default => lambda { Time.new("2010-01-01") }
+ attribute :created_at, :default => lambda { Time.utc("2010-01-01") }
end
class TestModel < MiniTest::Unit::TestCase
def setup
@@ -50,10 +50,10 @@
assert_equal 'Anonymous', post.attributes[:author]
end
def test_allows_lambda_as_default_value
post = Post.new(:title => "Hello, world")
- expected = Time.new("2010-01-01")
+ expected = Time.utc("2010-01-01")
assert_equal expected, post.created_at
assert_equal expected, post.attributes[:created_at]
end
def test_assings_id_and_saves_the_object