From bae7f8d367664dcb77a866467239266d45baebeb Mon Sep 17 00:00:00 2001 From: Joe Rafaniello Date: Thu, 12 Dec 2024 12:19:22 -0500 Subject: [PATCH] Remove unnecessary test failing on rails 7.1. Rails 7.1 detects this as a useless between clause, changing it to a simple = operator with the timestamp value. It was originally added in 6a94a1d93b801f88 #7075 and it seems it was only to capture the current behavior at the time. I think it's testing internals of rails and not really important for testing behavior of MiqExpression. In rails 7.1, it was failing with: expected: "\"vms\".\"last_scan_on\" BETWEEN '2011-01-10 00:00:00' AND '2011-01-10 00:00:00'" got: "\"vms\".\"last_scan_on\" = '2011-01-10 00:00:00'" --- spec/lib/miq_expression_spec.rb | 8 -------- 1 file changed, 8 deletions(-) diff --git a/spec/lib/miq_expression_spec.rb b/spec/lib/miq_expression_spec.rb index 4ce0f2af171..da1634a6104 100644 --- a/spec/lib/miq_expression_spec.rb +++ b/spec/lib/miq_expression_spec.rb @@ -757,14 +757,6 @@ sql, * = exp.to_sql expect(sql).to eq("\"vms\".\"last_scan_on\" BETWEEN '2011-01-10 08:00:00' AND '2011-01-10 17:00:00'") end - - it "generates the SQL for a FROM expression with two identical datetimes" do - exp = MiqExpression.new( - "FROM" => {"field" => "Vm-last_scan_on", "value" => ["2011-01-10 00:00", "2011-01-10 00:00"]} - ) - sql, * = exp.to_sql - expect(sql).to eq("\"vms\".\"last_scan_on\" BETWEEN '2011-01-10 00:00:00' AND '2011-01-10 00:00:00'") - end end context "relative date/time support" do