From ec655e85dccb22f4778bbe085fa1d1504eb0e2c5 Mon Sep 17 00:00:00 2001 From: lgalis Date: Wed, 31 May 2017 15:57:27 -0400 Subject: [PATCH 1/2] Fix reset button action for tenant tagging --- app/controllers/ops_controller/ops_rbac.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/ops_controller/ops_rbac.rb b/app/controllers/ops_controller/ops_rbac.rb index 28fbc9a8167..e519c3bca8d 100644 --- a/app/controllers/ops_controller/ops_rbac.rb +++ b/app/controllers/ops_controller/ops_rbac.rb @@ -21,6 +21,8 @@ def rbac_tags_edit 'MiqGroup' elsif nodes.first == "u" || nodes.last == "u" 'User' + elsif nodes.first == "tn" || nodes.last == "tn" + 'Tenant' else params[:tagging] end From 943e2d5dae012fa06139ff5b89712082855cb30b Mon Sep 17 00:00:00 2001 From: lgalis Date: Thu, 1 Jun 2017 17:08:52 -0400 Subject: [PATCH 2/2] Spec for tagging Reset button for tenants --- spec/controllers/ops_controller/ops_rbac_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/controllers/ops_controller/ops_rbac_spec.rb b/spec/controllers/ops_controller/ops_rbac_spec.rb index 5225c2d1741..cb3a684eccb 100644 --- a/spec/controllers/ops_controller/ops_rbac_spec.rb +++ b/spec/controllers/ops_controller/ops_rbac_spec.rb @@ -366,6 +366,13 @@ expect(assigns(:edit)).to be_nil end + it "resets tags edit" do + controller.instance_variable_set(:@_params, :button => "reset", :id => @tenant.id) + controller.send(:rbac_tenant_tags_edit) + expect(assigns(:flash_array).first[:message]).to include("All changes have been reset") + expect(assigns(:entries)).not_to be_nil + end + it "save tags" do controller.instance_variable_set(:@_params, :button => "save", :id => @tenant.id) controller.send(:rbac_tenant_tags_edit)