Skip to content

Commit

Permalink
Rails 5.2 correctly casts datetime fields provided dates.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrafanie committed May 4, 2020
1 parent 665855f commit a2cf27a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/lib/miq_expression_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@
context "date/time support" do
it "generates the SQL for a = expression with a date field" do
sql, * = described_class.new("=" => {"field" => "Vm-retires_on", "value" => "2016-01-01"}).to_sql
expect(sql).to eq(%q("vms"."retires_on" = '2016-01-01'))
expect(sql).to eq(%q("vms"."retires_on" = '2016-01-01 00:00:00'))
end

it "generates the SQL for an AFTER expression" do
Expand All @@ -601,7 +601,7 @@

it "generates the SQL for a != expression with a date field" do
sql, * = described_class.new("!=" => {"field" => "Vm-retires_on", "value" => "2016-01-01"}).to_sql
expect(sql).to eq(%q("vms"."retires_on" != '2016-01-01'))
expect(sql).to eq(%q("vms"."retires_on" != '2016-01-01 00:00:00'))
end

it "generates the SQL for an IS expression" do
Expand Down

0 comments on commit a2cf27a

Please sign in to comment.