[PATCH conductor] fix conductor spec suite on ruby 1.9
Mo Morsi
mmorsi at redhat.com
Thu Feb 23 21:20:37 UTC 2012
spec suite now fully runs successfully
---
src/app/controllers/application_controller.rb | 2 +-
src/app/controllers/deployables_controller.rb | 2 +-
.../controllers/permissions_controller_spec.rb | 2 +-
src/spec/controllers/pools_controller_spec.rb | 5 ++++-
4 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/app/controllers/application_controller.rb b/src/app/controllers/application_controller.rb
index be2ded3..aa80e44 100644
--- a/src/app/controllers/application_controller.rb
+++ b/src/app/controllers/application_controller.rb
@@ -112,7 +112,7 @@ class ApplicationController < ActionController::Base
end
# Returns an array of ids from params[:id], params[:ids].
- def ids_list(other_attrs=[])
+ def ids_list(*other_attrs)
other_attrs.each do |attr_key|
return params[attr_key].to_a if params.include?(attr_key)
end
diff --git a/src/app/controllers/deployables_controller.rb b/src/app/controllers/deployables_controller.rb
index e37bc4a..cd66133 100644
--- a/src/app/controllers/deployables_controller.rb
+++ b/src/app/controllers/deployables_controller.rb
@@ -116,7 +116,7 @@ class DeployablesController < ApplicationController
require_privilege(Privilege::CREATE, Deployable)
@deployable = Deployable.new(params[:deployable])
- @selected_catalogs = Catalog.find(params[:catalog_id].to_a)
+ @selected_catalogs = Catalog.find(Array(params[:catalog_id]))
@deployable.owner = current_user
if params.has_key? :url
diff --git a/src/spec/controllers/permissions_controller_spec.rb b/src/spec/controllers/permissions_controller_spec.rb
index 8c4741b..7cedb29 100644
--- a/src/spec/controllers/permissions_controller_spec.rb
+++ b/src/spec/controllers/permissions_controller_spec.rb
@@ -35,7 +35,7 @@ describe PermissionsController do
@permission = FactoryGirl.create(:permission, :user => @admin, :role => @old_role, :permission_object => @deployable)
post :multi_update, :permission_object_id => @deployable.id, :permission_object_type => @deployable.class.to_s,
- :permission_role_selected => "#{@permission.id},#{@new_role.id}", :polymorphic_path_extras => { 'catalog_id' => @catalog.id}
+ :permission_role_selected => ["#{@permission.id},#{@new_role.id}"], :polymorphic_path_extras => { 'catalog_id' => @catalog.id}
response.should redirect_to catalog_deployable_path(@catalog, @deployable)
end
diff --git a/src/spec/controllers/pools_controller_spec.rb b/src/spec/controllers/pools_controller_spec.rb
index 21af9d0..ba68755 100644
--- a/src/spec/controllers/pools_controller_spec.rb
+++ b/src/spec/controllers/pools_controller_spec.rb
@@ -119,7 +119,10 @@ describe PoolsController do
describe "#destroy" do
before do
@pool = Factory.build(:pool)
- Pool.stub!(:find).and_return([@pool])
+ @tpool = Factory.build(:tpool)
+ @pool.save!
+ @tpool.save!
+ Pool.stub!(:find).and_return([@pool], @tpool)
delete :multi_destroy, :pools_selected => [@pool.id], :format => :json
end
--
1.7.6.5
More information about the aeolus-devel
mailing list