diff options
| author | Xinhui | 2017-09-26 11:58:17 +0200 |
|---|---|---|
| committer | Xinhui | 2017-09-27 15:39:16 +0200 |
| commit | b8402fc9803db04b029a22c5bd9d33ee756ff4ec (patch) | |
| tree | 7e4ebea32ded3a12fbce1f7eed55dbb08c6dc7ea /spec | |
| parent | 5724f7c02a5238ef727e0c1674f2c69424563527 (diff) | |
| download | chouette-core-b8402fc9803db04b029a22c5bd9d33ee756ff4ec.tar.bz2 | |
Add dependent destroy on associations
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/models/compliance_control_set_spec.rb | 2 | ||||
| -rw-r--r-- | spec/models/compliance_control_spec.rb | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/spec/models/compliance_control_set_spec.rb b/spec/models/compliance_control_set_spec.rb index ededec5e0..edc684bbc 100644 --- a/spec/models/compliance_control_set_spec.rb +++ b/spec/models/compliance_control_set_spec.rb @@ -6,7 +6,7 @@ RSpec.describe ComplianceControlSet, type: :model do end it { should belong_to :organisation } - it { should have_many :compliance_controls } + it { should have_many(:compliance_controls).dependent(:destroy) } it { should validate_presence_of :name } end diff --git a/spec/models/compliance_control_spec.rb b/spec/models/compliance_control_spec.rb index c8797b938..d65e654cc 100644 --- a/spec/models/compliance_control_spec.rb +++ b/spec/models/compliance_control_spec.rb @@ -6,6 +6,7 @@ RSpec.describe ComplianceControl, type: :model do end it { should belong_to :compliance_control_set } + it { should has_one(:compliance_control_block).dependent(:destroy) } } it { should validate_presence_of :criticity } it { should validate_presence_of :name } |
