aboutsummaryrefslogtreecommitdiffstats
path: root/spec/support
diff options
context:
space:
mode:
authorTeddy Wing2018-02-09 12:21:30 +0100
committerTeddy Wing2018-02-09 12:21:30 +0100
commit42cff5c818140b193eb90fbb40b31e8a0c708207 (patch)
tree73ee69007c38a310c56952b8f16f8b3cb77b37c7 /spec/support
parentefddc15bfc8807e4156fe61c058bae34ac05754c (diff)
downloadchouette-core-42cff5c818140b193eb90fbb40b31e8a0c708207.tar.bz2
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
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/checksum_support.rb8
1 files changed, 8 insertions, 0 deletions
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