Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set_cache should invalidate existing related_resultset #110

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions t/resultset/cache.t
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ for my $i (0, 1) {
$artist_rset_after = $cd_rset->related_resultset('artist');

is scalar $cd_rset, 1, 'Track should belong to a CD';
is scalar @{ $cd_rset->get_cache // [] }, 1, 'CD cache should contain one item';
is scalar @{ $cd_rset->get_cache || [] }, 1, 'CD cache should contain one item';

is scalar $cd_rset->related_resultset('artist'), 1, 'Track should belong to an Artist';

# The following fails when DBIx::Class::ResultSet::set_cache does not clear related resultsets
is scalar @{ $artist_rset_after->get_cache // [] }, 1, 'Artist cache should contain one item';
is scalar @{ $artist_rset_after->get_cache || [] }, 1, 'Artist cache should contain one item';
}

done_testing;