diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-06-20 10:11:03 +0100 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-06-20 10:11:03 +0100 |
commit | 08dac0261325cd757b7146f9626f3c7b48cc672c (patch) | |
tree | bbb87c1728e552335107e573ecddcb97328b335d /spec/controllers/request_controller_spec.rb | |
parent | 9f578d781b7e575d89432facccfc5b41b4664297 (diff) |
Only invalidate a user's cached requests when their *name* changes. Otherwise we issue PURGEs every time, for example, we send out email alerts.
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r-- | spec/controllers/request_controller_spec.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index 99ab4cc71..01a663bf8 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -156,12 +156,18 @@ describe RequestController, "when changing things that appear on the request pag ir.public_body.save! PurgeRequest.all().map{|x| x.model_id}.should =~ ir.public_body.info_requests.map{|x| x.id} end - it "should purge the downstream cache when the user details are changed" do + it "should purge the downstream cache when the user name is changed" do ir = info_requests(:fancy_dog_request) ir.user.name = "Something new" ir.user.save! PurgeRequest.all().map{|x| x.model_id}.should =~ ir.user.info_requests.map{|x| x.id} end + it "should not purge the downstream cache when non-visible user details are changed" do + ir = info_requests(:fancy_dog_request) + ir.user.hashed_password = "some old hash" + ir.user.save! + PurgeRequest.all().count.should == 0 + end it "should purge the downstream cache when censor rules have changed" do # XXX really, CensorRules should execute expiry logic as part # of the after_save of the model. Currently this is part of |