Skip to content

Commit

Permalink
Remove unnecessary test failing on rails 7.1.
Browse files Browse the repository at this point in the history
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 6a94a1d #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'"
  • Loading branch information
jrafanie committed Jan 3, 2025
1 parent 8d9c0ef commit 0eb4c64
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions spec/lib/miq_expression_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0eb4c64

Please sign in to comment.