1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Inform Arel that we don't need to cast a value in tests

Part of the larger refactoring to remove type casting from Arel. We can
inform it that we already have the right type by wrapping the value in
an `Arel::Nodes::Quoted`. This commit can be reverted when we have
removed type casting from Arel in Rail 5.1
This commit is contained in:
Sean Griffin 2014-12-26 17:01:05 -07:00
parent b4e6e47471
commit 8ce6fd5594

View file

@ -145,11 +145,13 @@ class DefaultScopingTest < ActiveRecord::TestCase
assert_equal expected_5, received_5
expected_6 = Developer.order('salary DESC').collect(&:name)
received_6 = DeveloperOrderedBySalary.where(Developer.arel_table['name'].eq('David')).unscope(where: :name).collect(&:name)
# FIXME: Remove the Arel::Nodes::Quoted in Rails 5.1
received_6 = DeveloperOrderedBySalary.where(Developer.arel_table['name'].eq(Arel::Nodes::Quoted.new('David'))).unscope(where: :name).collect(&:name)
assert_equal expected_6, received_6
expected_7 = Developer.order('salary DESC').collect(&:name)
received_7 = DeveloperOrderedBySalary.where(Developer.arel_table[:name].eq('David')).unscope(where: :name).collect(&:name)
# FIXME: Remove the Arel::Nodes::Quoted in Rails 5.1
received_7 = DeveloperOrderedBySalary.where(Developer.arel_table[:name].eq(Arel::Nodes::Quoted.new('David'))).unscope(where: :name).collect(&:name)
assert_equal expected_7, received_7
end