From 42cff5c818140b193eb90fbb40b31e8a0c708207 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Fri, 9 Feb 2018 12:21:30 +0100 Subject: checksum_support.rb: Add test that checksum is the same on update Ensure the checksum doesn't change when we save it (and thus call `#update_checksum`) if the source hasn't changed. Refs #5416 --- spec/support/checksum_support.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'spec/support') diff --git a/spec/support/checksum_support.rb b/spec/support/checksum_support.rb index 760955274..f8dffb1b7 100644 --- a/spec/support/checksum_support.rb +++ b/spec/support/checksum_support.rb @@ -75,4 +75,12 @@ shared_examples 'checksum support' do expect(subject).to receive(:update_checksum).at_least(:once) subject.save end + + it "doesn't change the checksum on save if the source hasn't been changed" do + checksum = subject.checksum + + subject.save + + expect(subject.checksum).to eq(checksum) + end end -- cgit v1.2.3