diff options
| author | Teddy Wing | 2018-02-09 12:21:30 +0100 | 
|---|---|---|
| committer | Teddy Wing | 2018-02-09 12:21:30 +0100 | 
| commit | 42cff5c818140b193eb90fbb40b31e8a0c708207 (patch) | |
| tree | 73ee69007c38a310c56952b8f16f8b3cb77b37c7 /spec/support | |
| parent | efddc15bfc8807e4156fe61c058bae34ac05754c (diff) | |
| download | chouette-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.rb | 8 | 
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 | 
