aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/stop_area_referential_spec.rb
blob: d68b5b809968f25a31df4882f0cad8473ebaf8a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require 'rails_helper'

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

  it { is_expected.to have_many(:stop_area_referential_syncs) }
  it { is_expected.to have_many(:workbenches) }
  it { should validate_presence_of(:objectid_format) }
  it { should allow_value('').for(:registration_number_format) }
  it { should allow_value('X').for(:registration_number_format) }
  it { should allow_value('XXXXX').for(:registration_number_format) }
  it { should_not allow_value('123').for(:registration_number_format) }
  it { should_not allow_value('ABC').for(:registration_number_format) }
end