From 768b48ea03c08c20b1bbe4d4a1ea3f7213c4f7d9 Mon Sep 17 00:00:00 2001 From: Jose Farias Date: Wed, 13 Nov 2024 12:08:23 -0600 Subject: [PATCH] Use Filter class method to digest fixture params --- test/fixtures/filters.yml | 2 +- test/models/filter_test.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/fixtures/filters.yml b/test/fixtures/filters.yml index ff1f46bfa..e7134b059 100644 --- a/test/fixtures/filters.yml +++ b/test/fixtures/filters.yml @@ -3,4 +3,4 @@ jz_assignments: tags: mobile assignees: jz fields: <%= { indexed_by: :most_discussed }.to_json %> - params_digest: <%= Digest::MD5.hexdigest({ indexed_by: :most_discussed, tag_ids: [ ActiveRecord::FixtureSet.identify(:mobile) ], assignee_ids: [ ActiveRecord::FixtureSet.identify(:jz) ] }.to_json) %> + params_digest: <%= Filter.digest_params({ indexed_by: :most_discussed, tag_ids: [ ActiveRecord::FixtureSet.identify(:mobile) ], assignee_ids: [ ActiveRecord::FixtureSet.identify(:jz) ] }) %> diff --git a/test/models/filter_test.rb b/test/models/filter_test.rb index ae50cb915..2083cfd9c 100644 --- a/test/models/filter_test.rb +++ b/test/models/filter_test.rb @@ -3,10 +3,10 @@ require "test_helper" class FilterTest < ActiveSupport::TestCase test "persistence" do assert_difference "users(:david).filters.count", +1 do - filter = users(:david).filters.persist!(indexed_by: "most_boosted") + filter = users(:david).filters.persist!(indexed_by: "most_boosted", tag_ids: [ tags(:mobile).id ]) assert_changes "filter.reload.updated_at" do - assert_equal filter, users(:david).filters.persist!(indexed_by: "most_boosted") + assert_equal filter, users(:david).filters.persist!(indexed_by: "most_boosted", tag_ids: [ tags(:mobile).id ]) end end end