diff options
| -rw-r--r-- | app/controllers/referentials_controller.rb | 2 | ||||
| -rw-r--r-- | spec/controllers/referentials_controller_spec.rb | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/app/controllers/referentials_controller.rb b/app/controllers/referentials_controller.rb index b08f58514..b63741ef6 100644 --- a/app/controllers/referentials_controller.rb +++ b/app/controllers/referentials_controller.rb @@ -55,7 +55,7 @@ class ReferentialsController < InheritedResources::Base end def select_compliance_control_set - @compliance_control_sets = ComplianceControlSet.all + @compliance_control_sets = ComplianceControlSet.where(organisation: current_organisation) end def validate diff --git a/spec/controllers/referentials_controller_spec.rb b/spec/controllers/referentials_controller_spec.rb index a3be0dbd1..cc01727d1 100644 --- a/spec/controllers/referentials_controller_spec.rb +++ b/spec/controllers/referentials_controller_spec.rb @@ -22,4 +22,12 @@ describe ReferentialsController, :type => :controller do end end -end + describe 'GET select_compliance_control_set' do + it 'gets compliance control set for current organisation' do + compliance_control_set = create(:compliance_control_set, organisation: @user.organisation) + create(:compliance_control_set) + get :select_compliance_control_set, referential_id: referential.id + expect(assigns[:compliance_control_sets]).to eq([compliance_control_set]) + end + end + end |
