aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/chouette/footnote_spec.rb
blob: 98d751499cc4dc42a0019b44b7625d660aef7e4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require 'spec_helper'

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