Skip to content

Commit

Permalink
Start adding tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanahsmith committed Jun 15, 2021
1 parent 312f7c6 commit 27dac82
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/parent_model_expiration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,17 @@ def test_recursively_expire_parent_caches
fetched_name = Item.fetch(item.id).fetch_associated_records.first.fetch_deeply_associated_records.first.name
assert_equal("updated child", fetched_name)
end

def test_check_for_unsupported_parent_expiration_entries
Item.cache_has_many(:associated_records, embed: true)

Item.check_for_unsupported_parent_expiration_entries
exc = assert_raises do
AssociatedRecord.check_for_unsupported_parent_expiration_entries
end
assert_equal(
"Unsupported manual expiration of AssociatedRecord record that is embedded in parent associations:\n- item",
exc.message
)
end
end

0 comments on commit 27dac82

Please sign in to comment.