-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4241 from romanblanco/misc_pref_method_change_update
Refactoring provision method to use new rbac call
- Loading branch information
Showing
2 changed files
with
25 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
describe Mixins::Actions::HostActions::Misc do | ||
describe "#host_button_operation" do | ||
let(:controller) do | ||
return HostController.new | ||
end | ||
let(:admin_user) { FactoryGirl.create(:user, :role => "super_administrator") } | ||
let!(:host) { FactoryGirl.create(:host) } | ||
|
||
before do | ||
stub_user(:features => :all) | ||
EvmSpecHelper.create_guid_miq_server_zone | ||
login_as admin_user | ||
allow(User).to receive(:current_user).and_return(admin_user) | ||
allow(controller).to receive(:process_hosts).with([host.id], 'refresh_ems', 'Refresh') | ||
controller.instance_variable_set(:@_params, :id => Host.all.ids) | ||
end | ||
|
||
it "tests that find_records_with_rbac is called and does not fail" do | ||
expect(controller).to receive(:find_records_with_rbac).with(Host, Host.all.ids).and_return(Host.all) | ||
controller.send(:host_button_operation, 'refresh_ems', _('Refresh')) | ||
end | ||
end | ||
end |