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

Reset cached values after updating source data #398

Merged
merged 1 commit into from
Jan 25, 2017
Merged

Conversation

jcoyne
Copy link
Member

@jcoyne jcoyne commented Jan 24, 2017

subject.permissions_attributes = [{ id: permission_id, type: "person", access: "read", name: "jcoyne" }]
end
it "clears the cache" do
expect(subject.permissions.map(&:to_hash)).to eq [{ type: "person", access: "read", name: "jcoyne" }]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not following how this spec clears the cache?

I see line 58 warms the cache, then line 59 changes the permissions. And line 62 reflects the old cache value. Regarding cache clearing I would've expected a spec that leveraged expect {}.to change {}.from().to().

@jeremyf jeremyf merged commit 22e8106 into master Jan 25, 2017
@jeremyf jeremyf deleted the reset_cached branch January 25, 2017 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants