From 5d5c32899370662360723c67cb23febd5e964502 Mon Sep 17 00:00:00 2001 From: Danilo Grieco Date: Mon, 8 Nov 2021 16:43:38 +0100 Subject: [PATCH] Improve history spec Ignore order of returned keys --- spec/chrono_model/time_machine/history_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/chrono_model/time_machine/history_spec.rb b/spec/chrono_model/time_machine/history_spec.rb index 534987cd..ebc12246 100644 --- a/spec/chrono_model/time_machine/history_spec.rb +++ b/spec/chrono_model/time_machine/history_spec.rb @@ -52,7 +52,7 @@ describe 'does not add as_of_time when there are aggregates' do it { expect($t.foo.history.select('max(id)').to_sql).to_not match(/as_of_time/) } - it { expect($t.foo.history.except(:order).select('max(id) as foo, min(id) as bar').group('id').first.attributes.keys).to eq %w( id foo bar ) } + it { expect($t.foo.history.except(:order).select('max(id) as foo, min(id) as bar').group('id').first.attributes.keys).to match_array %w( id foo bar ) } end context '.sorted' do