aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/line_referential_spec.rb
blob: 8c6cb018b2a066db347c4f63ee54f6f859113d9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require 'spec_helper'

RSpec.describe LineReferential, :type => :model do
  it 'should have a valid factory' do
    expect(FactoryGirl.build(:line_referential)).to be_valid
  end

  it { should validate_presence_of(:name) }
  it { is_expected.to have_many(:line_referential_syncs) }
  it { is_expected.to have_many(:workbenches) }
  it { should validate_presence_of(:sync_interval) }

  describe "#transport_modes" do
    it 'returns a list of all transport modes' do
      expect(FactoryGirl.create(:line_referential).class.transport_modes).to match_array(StifTransportModeEnumerations.transport_modes )
    end
  end
end