Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Restore tests to ensure nothing is stripped.

  • Loading branch information...
commit 44ad9b5dfa84ec81a8bd02e355fb09f1fdf2a4dd 1 parent 0b38edc
@i0rek i0rek authored
Showing with 8 additions and 4 deletions.
  1. +8 −4 spec/mongoid/fields/internal/time_spec.rb
View
12 spec/mongoid/fields/internal/time_spec.rb
@@ -119,16 +119,16 @@
Time.now
end
- let(:millis) do
- ("%.3f" % time.to_f).split(".").last.to_i * 1000
- end
-
it "returns a time" do
field.serialize(time.to_datetime).should eq(
Time.local(time.year, time.month, time.day, time.hour, time.min, time.sec)
)
end
+ it "doesn't strip milli- or microseconds" do
+ field.serialize(time).to_f.should eq(time.to_f)
+ end
+
context "when using the ActiveSupport time zone" do
let(:datetime) do
@@ -169,6 +169,10 @@
field.serialize(time).should eq(time.utc)
end
+ it "doesn't strip milli- or microseconds" do
+ field.serialize(time).to_f.should eq(time.to_f)
+ end
+
end
context "when given an ActiveSupport::TimeWithZone" do
Please sign in to comment.
Something went wrong with that request. Please try again.