1
0
Fork 0
mirror of https://github.com/paper-trail-gem/paper_trail.git synced 2022-11-09 11:33:19 -05:00

Drop tests for arel < 6

This commit is contained in:
Jared Beck 2017-02-05 19:54:03 -05:00
parent e5d836ddfb
commit a7f93ad794
2 changed files with 5 additions and 22 deletions

View file

@ -32,11 +32,7 @@ module PaperTrail
matches = PaperTrail::Serializers::JSON.
where_object_condition(PaperTrail::Version.arel_table[:object], :arg1, "Val 1")
expect(matches.instance_of?(Arel::Nodes::Matches)).to(eq(true))
if Arel::VERSION >= "6"
expect("%\"arg1\":\"Val 1\"%").to(eq(matches.right.val))
else
expect("%\"arg1\":\"Val 1\"%").to(eq(matches.right))
end
expect("%\"arg1\":\"Val 1\"%").to(eq(matches.right.val))
end
end
@ -45,11 +41,7 @@ module PaperTrail
matches = PaperTrail::Serializers::JSON.
where_object_condition(PaperTrail::Version.arel_table[:object], :arg1, nil)
expect(matches.instance_of?(Arel::Nodes::Matches)).to(eq(true))
if Arel::VERSION >= "6"
expect("%\"arg1\":null%").to(eq(matches.right.val))
else
expect("%\"arg1\":null%").to(eq(matches.right))
end
expect("%\"arg1\":null%").to(eq(matches.right.val))
end
end
@ -59,13 +51,8 @@ module PaperTrail
where_object_condition(PaperTrail::Version.arel_table[:object], :arg1, -3.5)
expect(grouping.instance_of?(Arel::Nodes::Grouping)).to(eq(true))
matches = grouping.select { |v| v.instance_of?(Arel::Nodes::Matches) }
if Arel::VERSION >= "6"
expect("%\"arg1\":-3.5,%").to(eq(matches.first.right.val))
expect("%\"arg1\":-3.5}%").to(eq(matches.last.right.val))
else
expect("%\"arg1\":-3.5,%").to(eq(matches.first.right))
expect("%\"arg1\":-3.5}%").to(eq(matches.last.right))
end
expect("%\"arg1\":-3.5,%").to(eq(matches.first.right.val))
expect("%\"arg1\":-3.5}%").to(eq(matches.last.right.val))
end
end
end

View file

@ -44,11 +44,7 @@ class YamlTest < ActiveSupport::TestCase
"Val 1"
)
assert matches.instance_of?(Arel::Nodes::Matches)
if Arel::VERSION >= "6"
assert_equal matches.right.val, "%\narg1: Val 1\n%"
else
assert_equal matches.right, "%\narg1: Val 1\n%"
end
assert_equal matches.right.val, "%\narg1: Val 1\n%"
end
end
end