aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/compliance_control_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/compliance_control_spec.rb')
-rw-r--r--spec/models/compliance_control_spec.rb29
1 files changed, 5 insertions, 24 deletions
diff --git a/spec/models/compliance_control_spec.rb b/spec/models/compliance_control_spec.rb
index 50c2b7b8d..641209d4f 100644
--- a/spec/models/compliance_control_spec.rb
+++ b/spec/models/compliance_control_spec.rb
@@ -9,31 +9,12 @@ RSpec.describe ComplianceControl, type: :model do
it { should belong_to :compliance_control_set }
it { should belong_to :compliance_control_block }
- it 'should validate_presence_of criticity' do
- compliance_control.criticity = nil
- expect(compliance_control).not_to be_valid
- end
-
- it 'should validate_presence_of name' do
- compliance_control.name = nil
- expect(compliance_control).not_to be_valid
- end
- it 'should validate_presence_of code' do
- compliance_control.code = nil
- expect(compliance_control).not_to be_valid
+ 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 origin_code' do
- compliance_control.origin_code = nil
- expect(compliance_control).not_to be_valid
- end
-
- #TODO dont know why the 'shortcuts' below to validates presence dont work
- # That's why we dont it 'manually'
- # it { should validate_presence_of :criticity }
- # it { should validate_presence_of :name }
- # it { should validate_presence_of :code }
- # it { should validate_presence_of :origin_code }
+ it { should validate_presence_of :code }
+ it { should validate_presence_of :origin_code }
end