aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/chouette/footnote_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/chouette/footnote_spec.rb')
-rw-r--r--spec/models/chouette/footnote_spec.rb19
1 files changed, 16 insertions, 3 deletions
diff --git a/spec/models/chouette/footnote_spec.rb b/spec/models/chouette/footnote_spec.rb
index 5c09e3931..98d751499 100644
--- a/spec/models/chouette/footnote_spec.rb
+++ b/spec/models/chouette/footnote_spec.rb
@@ -1,9 +1,22 @@
require 'spec_helper'
-describe Chouette::Footnote do
-
- subject { build(:footnote) }
+describe Chouette::Footnote, type: :model do
+ let(:footnote) { create(:footnote) }
it { should validate_presence_of :line }
+ describe 'checksum' do
+ it_behaves_like 'checksum support', :footnote
+
+ context '#checksum_attributes' do
+ it 'should return code and label' do
+ expected = [footnote.code, footnote.label]
+ expect(footnote.checksum_attributes).to include(*expected)
+ end
+
+ it 'should not return other atrributes' do
+ expect(footnote.checksum_attributes).to_not include(footnote.updated_at)
+ end
+ end
+ end
end