diff options
| -rw-r--r-- | app/helpers/compliance_control_sets_helper.rb | 2 | ||||
| -rw-r--r-- | spec/features/compliance_control_sets_spec.rb | 15 | 
2 files changed, 16 insertions, 1 deletions
| diff --git a/app/helpers/compliance_control_sets_helper.rb b/app/helpers/compliance_control_sets_helper.rb index 448d5c008..0c63cb139 100644 --- a/app/helpers/compliance_control_sets_helper.rb +++ b/app/helpers/compliance_control_sets_helper.rb @@ -1,7 +1,7 @@  module ComplianceControlSetsHelper    def organisations_filters_values -    [current_organisation, Organisation.find_by_name("STIF")].uniq +    [current_organisation, *Organisation.find_by_name("STIF")].uniq    end    def floating_links ccs_id diff --git a/spec/features/compliance_control_sets_spec.rb b/spec/features/compliance_control_sets_spec.rb index 36dc5c2a9..0f4597db3 100644 --- a/spec/features/compliance_control_sets_spec.rb +++ b/spec/features/compliance_control_sets_spec.rb @@ -8,6 +8,9 @@ RSpec.describe "ComplianceControlSets", type: :feature do    let( :control_set ){ create :compliance_control_set, organisation: organisation }    let( :controls ){ control_set.compliance_controls } +  let(:other_orga) { create :organisation } +  let(:other_control_cset) { create :compliance_control_set, organisation: other_orga } +    let(:blox){      2.times.map{ | _ | create :compliance_control_block, compliance_control_set: control_set }    } @@ -95,6 +98,18 @@ RSpec.describe "ComplianceControlSets", type: :feature do    end +  describe 'index' do + +    before do +      visit compliance_control_sets_path +    end +     +    it "only showw compliance control sets from user organisation" do +      expect(page).not_to have_content (other_orga.name) +      expect(page).to have_content (organisation.name) +    end +  end +    def make_control ccblock=nil, times: 1, severity: :warning      times.times do        make_one_control ccblock, severity | 
