From 761d594c399c56da9dbfac6e6b4781dbc48e9c17 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Fri, 7 Oct 2022 11:11:44 -0700 Subject: [PATCH] Added test for mutating relation methods --- test/relation_test.rb | 7 +++++++ 1 file changed, 7 insertions(+), 0 deletions(-) diff --git a/test/relation_test.rb b/test/relation_test.rb index f82a5ed..3970bf3 100644 --- a/test/relation_test.rb +++ b/test/relation_test.rb @@ -16,6 +16,13 @@ class RelationTest < Minitest::Test assert_equal "Relation loaded", error.message end + def test_mutating + store_names ["Product A", "Product B"] + products = Product.search("*").order(:name) + products.limit!(1) + assert_equal ["Product A"], products.map(&:name) + end + def test_clone products = Product.search("*") assert_equal 10, products.limit(10).limit_value -- libgit2 0.21.0