Skip to content

Commit

Permalink
Merge pull request #1470 from lgalis/fix_reset_tagging_for_tenants
Browse files Browse the repository at this point in the history
Fix reset button action for tenant tagging
  • Loading branch information
mzazrivec committed Jun 6, 2017
2 parents 60ec803 + 943e2d5 commit b40d794
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/controllers/ops_controller/ops_rbac.rb
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions spec/controllers/ops_controller/ops_rbac_spec.rb
Expand Up @@ -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)
Expand Down

0 comments on commit b40d794

Please sign in to comment.