diff --git a/activerecord/test/cases/scoping/named_scoping_test.rb b/activerecord/test/cases/scoping/named_scoping_test.rb index 232e437be96bd2114c992f165a84961bb7865e04..0c648575cbe995f29c51c4cf98b2f1b873fc2189 100644 --- a/activerecord/test/cases/scoping/named_scoping_test.rb +++ b/activerecord/test/cases/scoping/named_scoping_test.rb @@ -402,11 +402,11 @@ def pro; end def test_spaces_in_scope_names klass = Class.new(ActiveRecord::Base) do self.table_name = "topics" - scope :"title containing space", -> { where("title LIKE '% %'") } + scope :"title containing space", ->(space: " ") { where("title LIKE '%#{space}%'") } scope :approved, -> { where(approved: true) } end - assert_equal klass.send(:"title containing space"), klass.where("title LIKE '% %'") - assert_equal klass.approved.send(:"title containing space"), klass.approved.where("title LIKE '% %'") + assert_equal klass.where("title LIKE '% %'"), klass.send(:"title containing space", space: " ") + assert_equal klass.approved.where("title LIKE '% %'"), klass.approved.send(:"title containing space", space: " ") end def test_find_all_should_behave_like_select