Use Filter class method to digest fixture params

This commit is contained in:
Jose Farias
2024-11-13 12:08:23 -06:00
parent 8301db767a
commit 768b48ea03
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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) ] }) %>
+2 -2
View File
@@ -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