Skip to content

Commit

Permalink
Merge pull request #2923 from AparnaKarve/bz1515710_fix_helper_method…
Browse files Browse the repository at this point in the history
…_access

Fix `ProvisionCustomizeHelper` helper method access in VM controllers
  • Loading branch information
Dan Clarizio authored Dec 4, 2017
2 parents d549f6a + e89717d commit 3f552a2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/controllers/vm_common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module VmCommon
extend ActiveSupport::Concern
include ActionView::Helpers::JavaScriptHelper
include ChargebackPreview
include ProvisionCustomizeHelper

def textual_group_list
[
Expand All @@ -14,6 +15,8 @@ def textual_group_list
private :textual_group_list
helper_method :textual_group_list
helper_method :parent_choices_with_no_parent_choice
helper_method :select_check?
helper_method :disable_check?
end

# handle buttons pressed on the button bar
Expand Down
11 changes: 11 additions & 0 deletions spec/controllers/vm_infra_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -577,4 +577,15 @@
include_examples '#download_summary_pdf', :template_vmware

it_behaves_like "explorer controller with custom buttons"

it "executes select_check? and disable_check? helper methods" do
admin_user = FactoryGirl.create(:user_with_group, :role => 'super_administrator')
wf = FactoryGirl.create(:miq_provision_workflow, :requester => admin_user)

controller.send(:select_check?, wf)
expect(response.status).to eq(200)

controller.send(:disable_check?, wf)
expect(response.status).to eq(200)
end
end

0 comments on commit 3f552a2

Please sign in to comment.