Skip to content

Commit

Permalink
Removed Mixin for Transform - already included
Browse files Browse the repository at this point in the history
  • Loading branch information
lgalis committed Nov 17, 2017
1 parent 02fb967 commit 5745233
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion app/controllers/ems_common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def button
"#{pfx}_protect", "#{pfx}_ownership", "#{pfx}_refresh", "#{pfx}_right_size",
"#{pfx}_reconfigure", "storage_tag", "ems_cluster_compare",
"ems_cluster_protect", "ems_cluster_tag", "#{pfx}_resize", "#{pfx}_live_migrate",
"#{pfx}_evacuate"].include?(params[:pressed]) &&
"#{pfx}_evacuate", "#{pfx}_transform"].include?(params[:pressed]) &&
@flash_array.nil?

unless ["host_edit", "#{pfx}_edit", "#{pfx}_miq_request_new", "#{pfx}_clone",
Expand Down
1 change: 0 additions & 1 deletion app/controllers/vm_infra_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ class VmInfraController < ApplicationController
include VmCommon # common methods for vm controllers
include VmRemote # methods for VM remote access
include VmShowMixin
include Mixins::Actions::VmActions::Transform

before_action :check_privileges
before_action :get_session_data
Expand Down
26 changes: 13 additions & 13 deletions spec/controllers/ems_infra_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,20 +109,20 @@
end
end

describe "#scaling" do
before do
stub_user(:features => :all)
@ems = instance_double("mock_infra_provider", :id => 1, :hosts => [1, 2])
allow(controller).to receive(:get_infra_provider).and_return(@ems)
p1 = instance_double("mock_stack_parameter1", :name => "compute-1::count", :value => 1)
p2 = instance_double("mock_stack_parameter2", :name => "controller-1::count", :value => 1)
stack_parameters = [p1, p2]
@orchestration_stack = instance_double("mock stack", :id => 1, :parameters => stack_parameters, :update_ready? => true)
allow(@ems).to receive(:direct_orchestration_stacks).and_return([@orchestration_stack])
@orchestration_stack_parameter_compute = FactoryGirl.create(:orchestration_stack_parameter_openstack_infra_compute)
end
before do
stub_user(:features => :all)
@ems = instance_double("mock_infra_provider", :id => 1, :hosts => [1, 2])
allow(controller).to receive(:get_infra_provider).and_return(@ems)
p1 = instance_double("mock_stack_parameter1", :name => "compute-1::count", :value => 1)
p2 = instance_double("mock_stack_parameter2", :name => "controller-1::count", :value => 1)
stack_parameters = [p1, p2]
@orchestration_stack = instance_double("mock stack", :id => 1, :parameters => stack_parameters, :update_ready? => true)
allow(@ems).to receive(:direct_orchestration_stacks).and_return([@orchestration_stack])
@orchestration_stack_parameter_compute = FactoryGirl.create(:orchestration_stack_parameter_openstack_infra_compute)
end

it "when values are not changed" do
it "when values are not changed" do
describe "#scaling" do
post :scaling, :params => { :id => @ems.id, :scale => "", :orchestration_stack_id => @orchestration_stack.id }
expect(controller.send(:flash_errors?)).to be_truthy
flash_messages = assigns(:flash_array)
Expand Down

0 comments on commit 5745233

Please sign in to comment.