aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorRobert2017-09-29 17:01:18 +0200
committerRobert2017-10-02 10:52:07 +0200
commitea6537e2f520ca9abba0ca63c68ee42afe08d872 (patch)
tree51fa3272c33e1947e39de5d6a1e4d7cb76efd6e6 /spec
parent8f11900221be0837e0ee9717746cd4d952a64794 (diff)
downloadchouette-core-ea6537e2f520ca9abba0ca63c68ee42afe08d872.tar.bz2
Refs: #4627@0.15h;
Put old behavior under tests, thusly also showing the motivation of this ticket.
Diffstat (limited to 'spec')
-rw-r--r--spec/models/compliance_control_spec.rb2
-rw-r--r--spec/models/generic_attribute_control/min_max_spec.rb8
-rw-r--r--spec/models/generic_attribute_control/parent_class_spec.rb8
-rw-r--r--spec/models/generic_attribute_control/pattern_spec.rb8
-rw-r--r--spec/models/generic_attribute_control/uniqueness_spec.rb8
5 files changed, 32 insertions, 2 deletions
diff --git a/spec/models/compliance_control_spec.rb b/spec/models/compliance_control_spec.rb
index 0fc830021..50c2b7b8d 100644
--- a/spec/models/compliance_control_spec.rb
+++ b/spec/models/compliance_control_spec.rb
@@ -1,5 +1,3 @@
-require 'rails_helper'
-
RSpec.describe ComplianceControl, type: :model do
let(:compliance_control) { create :compliance_control }
diff --git a/spec/models/generic_attribute_control/min_max_spec.rb b/spec/models/generic_attribute_control/min_max_spec.rb
new file mode 100644
index 000000000..5eb8ed74e
--- /dev/null
+++ b/spec/models/generic_attribute_control/min_max_spec.rb
@@ -0,0 +1,8 @@
+RSpec.describe GenericAttributeControl::MinMax do
+ context 'class attributes' do
+ it 'are correctly set' do
+ expect( described_class.default_criticity ).to eq(:warning)
+ expect( described_class.default_code).to eq("3-Generic-2")
+ end
+ end
+end
diff --git a/spec/models/generic_attribute_control/parent_class_spec.rb b/spec/models/generic_attribute_control/parent_class_spec.rb
new file mode 100644
index 000000000..be60f71be
--- /dev/null
+++ b/spec/models/generic_attribute_control/parent_class_spec.rb
@@ -0,0 +1,8 @@
+RSpec.describe ComplianceControl do
+ context 'class attributes' do
+ it 'are correctly set' do
+ expect( described_class.default_criticity ).to eq( :warning )
+ expect( described_class.default_code ).to eq( "" )
+ end
+ end
+end
diff --git a/spec/models/generic_attribute_control/pattern_spec.rb b/spec/models/generic_attribute_control/pattern_spec.rb
new file mode 100644
index 000000000..d1f2dcb5f
--- /dev/null
+++ b/spec/models/generic_attribute_control/pattern_spec.rb
@@ -0,0 +1,8 @@
+RSpec.describe GenericAttributeControl::Pattern do
+ context 'class attributes' do
+ it 'are correctly set' do
+ expect( described_class.default_criticity ).to eq( :warning )
+ expect( described_class.default_code ).to eq( "3-Generic-3" )
+ end
+ end
+end
diff --git a/spec/models/generic_attribute_control/uniqueness_spec.rb b/spec/models/generic_attribute_control/uniqueness_spec.rb
new file mode 100644
index 000000000..dbf4feff4
--- /dev/null
+++ b/spec/models/generic_attribute_control/uniqueness_spec.rb
@@ -0,0 +1,8 @@
+RSpec.describe GenericAttributeControl::Uniqueness do
+ context 'class attributes' do
+ it 'are correctly set' do
+ expect( described_class.default_criticity ).to eq( :warning )
+ expect( described_class.default_code ).to eq( "3-Generic-3" )
+ end
+ end
+end