diff --git a/spec/models/json_version_spec.rb b/spec/models/json_version_spec.rb index ac6b0cfc..694f8771 100644 --- a/spec/models/json_version_spec.rb +++ b/spec/models/json_version_spec.rb @@ -1,6 +1,8 @@ -if JsonVersion.table_exists? +require 'rails_helper' - require 'rails_helper' +# The `json_versions` table tests postgres' `json` data type. So, that +# table is only created when testing against postgres and ActiveRecord >= 4. +if JsonVersion.table_exists? describe JsonVersion, :type => :model do it "should include the `VersionConcern` module to get base functionality" do diff --git a/test/unit/model_test.rb b/test/unit/model_test.rb index e1c27efa..5a03f2e5 100644 --- a/test/unit/model_test.rb +++ b/test/unit/model_test.rb @@ -442,7 +442,7 @@ class HasPaperTrailModelTest < ActiveSupport::TestCase end should 'handle decimals' do - assert_in_delta 2.71828, @previous.a_decimal, 0.00001 + assert_in_delta 2.7183, @previous.a_decimal, 0.0001 end should 'handle datetimes' do @@ -484,7 +484,7 @@ class HasPaperTrailModelTest < ActiveSupport::TestCase assert_equal 'The quick brown fox', @last.reify.a_text assert_equal 42, @last.reify.an_integer assert_in_delta 153.01, @last.reify.a_float, 0.001 - assert_in_delta 2.71828, @last.reify.a_decimal, 0.00001 + assert_in_delta 2.7183, @last.reify.a_decimal, 0.0001 assert_equal @date_time.to_time.utc.to_i, @last.reify.a_datetime.to_time.utc.to_i assert_equal @time.utc.to_i, @last.reify.a_time.utc.to_i assert_equal @date, @last.reify.a_date