Use Filter class method to digest fixture params
This commit is contained in:
Vendored
+1
-1
@@ -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) ] }) %>
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user