aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/compliance_control_spec.rb
blob: 641209d4fc6167091f68305dac8c65701d03bb9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
RSpec.describe ComplianceControl, type: :model do

  let(:compliance_control) { create :compliance_control }

  it 'should have a valid factory' do
    expect(compliance_control).to be_valid
  end

  it { should belong_to :compliance_control_set }
  it { should belong_to :compliance_control_block }


  it { should validate_presence_of :criticity }
  it 'should validate_presence_of :name' do
    expect( build :compliance_control, name: '' ).to_not be_valid 
  end
  it { should validate_presence_of :code }
  it { should validate_presence_of :origin_code }

end