Skip to content

Commit

Permalink
Added spec for VM template set ownership
Browse files Browse the repository at this point in the history
  • Loading branch information
lgalis committed Apr 27, 2017
1 parent 928955a commit ae4b283
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions spec/controllers/application_controller/ci_processing_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -865,4 +865,33 @@
include("Retirement initiated for 1 Service from the %{product} Database" % {:product => I18n.t('product.name')})
end
end

describe MiqTemplateController do
context "#vm_button_operation" do
before do
_guid, @miq_server, @zone = EvmSpecHelper.remote_guid_miq_server_zone
allow(MiqServer).to receive(:my_zone).and_return("default")
controller.instance_variable_set(:@lastaction, "show_list")
end

it "should continue to set ownership for a template" do
controller.request.parameters["controller"] = "miq_template"
allow(controller).to receive(:role_allows?).and_return(true)
allow(controller).to receive(:drop_breadcrumb)
template = FactoryGirl.create(:template,
:ext_management_system => FactoryGirl.create(:ems_openstack_infra),
:storage => FactoryGirl.create(:storage)
)
controller.instance_variable_set(:@_params,
:miq_grid_checks => "#{template.id}",
:pressed => 'miq_template_set_ownership')
expect(controller).to receive(:javascript_redirect).with(:controller => "miq_template",
:action => 'ownership',
:rec_ids => [template.id],
:escape => false)
controller.send('set_ownership')
end
end
end
end

0 comments on commit ae4b283

Please sign in to comment.