diff options
| author | Robert | 2017-10-27 12:49:47 +0200 |
|---|---|---|
| committer | Robert | 2017-10-31 19:08:52 +0100 |
| commit | e0d52eef6b0c48e646cfc7e03322647b1a15181f (patch) | |
| tree | 6dceb4dba9cbe89e420b7bdd4dfbfbf3db853431 /spec | |
| parent | 63f3a7838140b2cac5dfca7cc80cb78f2c369c69 (diff) | |
| download | chouette-core-e0d52eef6b0c48e646cfc7e03322647b1a15181f.tar.bz2 | |
Refs: #4774;
DB Setup for specs
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/features/complience_control_sets_spec.rb | 36 | ||||
| -rw-r--r-- | spec/features/connection_links_spec.rb | 2 | ||||
| -rw-r--r-- | spec/models/compliance_control_spec.rb | 4 |
3 files changed, 37 insertions, 5 deletions
diff --git a/spec/features/complience_control_sets_spec.rb b/spec/features/complience_control_sets_spec.rb new file mode 100644 index 000000000..0acf42d7f --- /dev/null +++ b/spec/features/complience_control_sets_spec.rb @@ -0,0 +1,36 @@ +RSpec.describe "ComplianceControlSets", type: :feature do + + login_user + + let( :control_set ){ create :compliance_control_set } + let( :min_max_class ){ GenericAttributeControl::MinMax } + let( :pattern_class ){ GenericAttributeControl::Pattern } + + let( :common_atts ){{ + compliance_control_set: control_set, + }} + + + let(:blox){ + 3.times.map{ | _ | create :compliance_control_block, compliance_control_set: control_set } + } + + before do + blox.each do | block | + create( :generic_attribute_control_min_max, code: random_string, compliance_control_block: block, **common_atts ) + create( :generic_attribute_control_pattern, code: random_string, compliance_control_block: block, **common_atts ) + end + end + + describe 'show' do + it 'check setup' do + each_kind_count = 3 + expect( min_max_class.count ).to eq(each_kind_count) + expect( pattern_class.count ).to eq(each_kind_count) + query = ComplianceControl.group(:compliance_control_block) + require 'pry'; binding.pry + end + + end + +end diff --git a/spec/features/connection_links_spec.rb b/spec/features/connection_links_spec.rb index 7272242fe..2f6283dcd 100644 --- a/spec/features/connection_links_spec.rb +++ b/spec/features/connection_links_spec.rb @@ -1,4 +1,4 @@ -RSpec.describe "ConnectionLinks", :type => :feature do +RSpec.describe "ConnectionLinks", type: :feature do login_user let!(:connection_links) { Array.new(2) { create(:connection_link) } } diff --git a/spec/models/compliance_control_spec.rb b/spec/models/compliance_control_spec.rb index db73dab21..4267459ea 100644 --- a/spec/models/compliance_control_spec.rb +++ b/spec/models/compliance_control_spec.rb @@ -4,10 +4,6 @@ RSpec.describe ComplianceControl, type: :model do let(:compliance_control) { build_stubbed :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 } |
