Resolves
https://bugzilla.redhat.com/show_bug.cgi?id=723333
Removes a failing test that only applied to new UI.
---
src/app/controllers/deployments_controller.rb | 24 +++++++-------
.../controllers/hardware_profiles_controller.rb | 8 ++---
src/app/controllers/instances_controller.rb | 20 ++++++------
src/app/controllers/pool_families_controller.rb | 2 +-
src/app/controllers/pools_controller.rb | 14 ++++----
.../controllers/provider_accounts_controller.rb | 11 +++---
src/app/controllers/providers_controller.rb | 2 +-
src/app/controllers/realms_controller.rb | 2 +-
src/app/controllers/roles_controller.rb | 2 +-
src/app/controllers/users_controller.rb | 2 +-
src/spec/controllers/provider_controller_spec.rb | 34 --------------------
11 files changed, 43 insertions(+), 78 deletions(-)
delete mode 100644 src/spec/controllers/provider_controller_spec.rb
diff --git a/src/app/controllers/deployments_controller.rb
b/src/app/controllers/deployments_controller.rb
index c10ef01..641d42b 100644
--- a/src/app/controllers/deployments_controller.rb
+++ b/src/app/controllers/deployments_controller.rb
@@ -12,8 +12,8 @@ class DeploymentsController < ApplicationController
def index
save_breadcrumb(deployments_path(:viewstate => viewstate_id))
respond_to do |format|
- format.js { render :partial => 'list' }
format.html
+ format.js { render :partial => 'list' }
format.json { render :json => @deployments }
end
end
@@ -31,8 +31,8 @@ class DeploymentsController < ApplicationController
@suggested_deployables = SuggestedDeployable.list_for_user(current_user,
Privilege::USE)
init_new_deployment_attrs
respond_to do |format|
- format.js { render :partial => 'launch_new' }
format.html
+ format.js { render :partial => 'launch_new' }
format.json { render :json => @deployment }
end
end
@@ -53,13 +53,13 @@ class DeploymentsController < ApplicationController
:failures => errors
}
end
- format.js { render :partial => 'new' }
format.html
+ format.js { render :partial => 'new' }
format.json { render :json => @deployment }
else
init_new_deployment_attrs
- format.js { render :partial => 'launch_new' }
format.html { render :launch_new }
+ format.js { render :partial => 'launch_new' }
format.json { render :json => @deployment.errors, :status =>
:unprocessable_entity }
end
end
@@ -81,19 +81,19 @@ class DeploymentsController < ApplicationController
:successes => status[:successes]
}
end
+ format.html { redirect_to deployment_path(@deployment) }
format.js do
@deployment_properties = @deployment.properties
render :partial => 'properties'
end
- format.html { redirect_to deployment_path(@deployment) }
format.json { render :json => @deployment, :status => :created }
else
# We need @pool to re-display the form
@pool = @deployment.pool
flash.now[:warning] = "Deployment launch failed"
init_new_deployment_attrs
- format.js { launch_new }
format.html { render :action => 'new' }
+ format.js { launch_new }
format.json { render :json => @deployment.errors, :status =>
:unprocessable_entity }
end
end
@@ -125,8 +125,8 @@ class DeploymentsController < ApplicationController
@view = @details_tab[:view]
end
respond_to do |format|
- format.js { render :partial => @details_tab[:view] }
format.html { render :action => 'show'}
+ format.js { render :partial => @details_tab[:view] }
format.json { render :json => @deployment }
end
end
@@ -134,8 +134,8 @@ class DeploymentsController < ApplicationController
def edit
require_privilege(Privilege::MODIFY, @deployment)
respond_to do |format|
- format.js { render :partial => 'edit' }
format.html
+ format.js { render :partial => 'edit' }
format.json { render :json => @deployment }
end
end
@@ -147,16 +147,16 @@ class DeploymentsController < ApplicationController
respond_to do |format|
if check_privilege(Privilege::MODIFY, @deployment) and
@deployment.update_attributes(attrs)
flash[:success] = t('deployments.updated', :count => 1, :list =>
@deployment.name)
+ format.html { redirect_to @deployment }
format.js do
@deployment_properties = @deployment.properties
render :partial => 'properties'
end
- format.html { redirect_to @deployment }
format.json { render :json => @deployment }
else
flash[:error] = t('deployments.not_updated', :count => 1, :list =>
@deployment.name)
- format.js { render :partial => 'edit' }
format.html { render :action => :edit }
+ format.js { render :partial => 'edit' }
format.json { render :json => @deployment.errors, :status =>
:unprocessable_entity }
end
end
@@ -176,11 +176,11 @@ class DeploymentsController < ApplicationController
flash[:success] = t('deployments.deleted', :list => destroyed, :count
=> destroyed.size) if destroyed.present?
flash[:error] = t('deployments.not_deleted', :list => failed, :count =>
failed.size) if failed.present?
respond_to do |format|
+ format.html { redirect_to pools_url }
format.js do
load_deployments
render :partial => 'list'
end
- format.html { redirect_to pools_url }
format.json { render :json => {:success => destroyed, :errors => failed}
}
end
end
@@ -212,11 +212,11 @@ class DeploymentsController < ApplicationController
flash[:notice] = notices unless notices.blank?
flash[:error] = errors unless errors.blank?
respond_to do |format|
+ format.html { redirect_to pools_path(:details_tab => 'deployments',
:filter_view => filter_view?) }
format.js do
load_deployments
render :partial => 'list'
end
- format.html { redirect_to pools_path(:details_tab => 'deployments',
:filter_view => filter_view?) }
format.json { render :json => {:success => notices, :errors => errors} }
end
end
diff --git a/src/app/controllers/hardware_profiles_controller.rb
b/src/app/controllers/hardware_profiles_controller.rb
index c7f3818..5f4f9d2 100644
--- a/src/app/controllers/hardware_profiles_controller.rb
+++ b/src/app/controllers/hardware_profiles_controller.rb
@@ -15,14 +15,12 @@ class HardwareProfilesController < ApplicationController
save_breadcrumb(hardware_profiles_path)
@params = params
respond_to do |format|
+ format.html { load_hardware_profiles }
format.js do
build_hardware_profile(params[:hardware_profile])
matching_provider_hardware_profiles
render :partial => 'matching_provider_hardware_profiles' and return
end
- format.html do
- load_hardware_profiles
- end
end
end
@@ -35,20 +33,20 @@ class HardwareProfilesController < ApplicationController
save_breadcrumb(hardware_profile_path(@hardware_profile), @hardware_profile.name)
respond_to do |format|
+ format.html
format.js do
if params.delete :details_pane
render :partial => 'layouts/details_pane' and return
end
render :partial => @details_tab and return
end
- format.html
end
end
def new
respond_to do |format|
- format.js { render :partial => 'matching_provider_hardware_profiles' }
format.html { render :action => 'new'}
+ format.js { render :partial => 'matching_provider_hardware_profiles' }
end
end
diff --git a/src/app/controllers/instances_controller.rb
b/src/app/controllers/instances_controller.rb
index c64380e..92b2112 100644
--- a/src/app/controllers/instances_controller.rb
+++ b/src/app/controllers/instances_controller.rb
@@ -9,8 +9,8 @@ class InstancesController < ApplicationController
load_instances
respond_to do |format|
- format.js { render :partial => 'list' }
format.html
+ format.js { render :partial => 'list' }
format.json { render :json => @instances }
end
end
@@ -27,13 +27,13 @@ class InstancesController < ApplicationController
@details_tab = params[:details_tab].blank? ? 'properties' :
params[:details_tab]
save_breadcrumb(instance_path(@instance), @instance.name)
respond_to do |format|
+ format.html { render :action => 'show'}
format.js do
if params.delete :details_pane
render :partial => 'layouts/details_pane' and return
end
render :partial => @details_tab and return
end
- format.html { render :action => 'show'}
format.json { render :json => @instance }
end
end
@@ -41,8 +41,8 @@ class InstancesController < ApplicationController
def edit
require_privilege(Privilege::MODIFY, @instance)
respond_to do |format|
- format.js { render :partial => 'edit', :id => @instance.id }
format.html
+ format.js { render :partial => 'edit', :id => @instance.id }
format.json { render :json => @instance }
end
end
@@ -56,13 +56,13 @@ class InstancesController < ApplicationController
respond_to do |format|
if check_privilege(Privilege::MODIFY, @instance) and
@instance.update_attributes(attrs)
flash[:success] = t('instances.updated', :count => 1, :list =>
@instance.name)
- format.js { render :partial => 'properties' }
format.html { redirect_to @instance }
+ format.js { render :partial => 'properties' }
format.json { render :json => @instance }
else
flash[:error] = t('instances.not_updated', :count =>1, :list =>
@instance.name)
- format.js { render :partial => 'edit' }
format.html { render :action => :edit }
+ format.js { render :partial => 'edit' }
format.json { render :json => @instance.errors, :status =>
:unprocessable_entity }
end
end
@@ -83,12 +83,12 @@ class InstancesController < ApplicationController
flash[:error] = t('instances.not_deleted', :list => failed.to_sentence,
:count => failed.size) if failed.present?
respond_to do |format|
# FIXME: _list does not show flash messages, but I'm not sure that showing
_list is proper anyway
+ format.html { render :action => :show }
format.js do
set_view_vars
load_instances
render :partial => 'list'
end
- format.html { render :action => :show }
format.json { render :json => {:success => destroyed, :errors => failed}
}
end
end
@@ -97,18 +97,18 @@ class InstancesController < ApplicationController
respond_to do |format|
if @instance.instance_key.nil?
flash[:warning] = "SSH Key not found for this Instance."
- format.js { render :partial => 'properties' }
format.html { redirect_to instance_path(@instance) }
+ format.js { render :partial => 'properties' }
format.json { render :json => flash[:warning], :status => :not_found }
else
+ format.html { send_data @instance.instance_key.pem,
+ :filename =>
"#{(a)instance.instance_key.name}.pem",
+ :type => "text/plain" }
format.js do
send_data @instance.instance_key.pem,
:filename =>
"#{(a)instance.instance_key.name}.pem",
:type => "text/plain"
end
- format.html { send_data @instance.instance_key.pem,
- :filename =>
"#{(a)instance.instance_key.name}.pem",
- :type => "text/plain" }
format.json { render :json => {:key => @instance.instance_key.pem,
:filename =>
"#{(a)instance.instance_key.name}.pem",
:type => "text/plain" } }
diff --git a/src/app/controllers/pool_families_controller.rb
b/src/app/controllers/pool_families_controller.rb
index cd60ff0..790cb63 100644
--- a/src/app/controllers/pool_families_controller.rb
+++ b/src/app/controllers/pool_families_controller.rb
@@ -51,13 +51,13 @@ class PoolFamiliesController < ApplicationController
save_breadcrumb(pool_family_path(@pool_family), @pool_family.name)
respond_to do |format|
+ format.html
format.js do
if params.delete :details_pane
render :partial => 'layouts/details_pane' and return
end
render :partial => @details_tab and return
end
- format.html
end
end
diff --git a/src/app/controllers/pools_controller.rb
b/src/app/controllers/pools_controller.rb
index 745eb5b..b23ef47 100644
--- a/src/app/controllers/pools_controller.rb
+++ b/src/app/controllers/pools_controller.rb
@@ -45,6 +45,7 @@ class PoolsController < ApplicationController
end
statistics
respond_to do |format|
+ format.html { @view = filter_view? ? 'layouts/tabpanel' :
'pretty_list' }
format.js do
if filter_view?
render :partial => params[:only_tab] == "true" ?
@details_tab[:view] : 'layouts/tabpanel'
@@ -52,7 +53,6 @@ class PoolsController < ApplicationController
render :partial => 'pretty_list'
end
end
- format.html { @view = filter_view? ? 'layouts/tabpanel' :
'pretty_list' }
format.json { render :json => @pools }
end
end
@@ -79,8 +79,8 @@ class PoolsController < ApplicationController
@deployments = @pool.deployments if @details_tab[:id] == 'deployments'
@view = @details_tab[:view]
respond_to do |format|
- format.js { render :partial => @view }
format.html { render :action => :show}
+ format.js { render :partial => @view }
format.json { render :json => @pool }
end
end
@@ -115,8 +115,8 @@ class PoolsController < ApplicationController
format.json { render :json => @pool, :status => :created }
else
flash.now[:warning] = "Pool creation failed."
- format.js { render :partial => 'new' }
format.html { render :new }
+ format.js { render :partial => 'new' }
format.json { render :json => @pool.errors, :status =>
:unprocessable_entity }
end
end
@@ -127,8 +127,8 @@ class PoolsController < ApplicationController
require_privilege(Privilege::MODIFY, @pool)
@quota = @pool.quota
respond_to do |format|
- format.js { render :partial => 'edit' }
format.html
+ format.js { render :partial => 'edit' }
format.json { render :json => @pool }
end
end
@@ -143,13 +143,13 @@ class PoolsController < ApplicationController
respond_to do |format|
if @pool.update_attributes(params[:pool])
flash[:notice] = "Pool updated."
- format.js { render :partial => 'show', :id => @pool.id }
format.html { redirect_to :action => 'show', :id => @pool.id }
+ format.js { render :partial => 'show', :id => @pool.id }
format.json { render :json => @pool }
else
flash[:error] = "Pool wasn't updated!"
- format.js { render :partial => 'edit', :id => @pool.id }
format.html { render :action => :edit }
+ format.js { render :partial => 'edit', :id => @pool.id }
format.json { render :json => @pool.errors, :status =>
:unprocessable_entity }
end
end
@@ -173,11 +173,11 @@ class PoolsController < ApplicationController
flash[:error] = t('pools.index.pool_not_deleted', :list =>
failed.to_sentence, :count => failed.size) if failed.present?
respond_to do |format|
# TODO - What is expected to be returned on an AJAX delete?
+ format.html { redirect_to pools_url }
format.js do
load_pools
render :partial => 'list'
end
- format.html { redirect_to pools_url }
format.json { render :json => {:success => destroyed, :errors => failed}
}
end
end
diff --git a/src/app/controllers/provider_accounts_controller.rb
b/src/app/controllers/provider_accounts_controller.rb
index 63523b4..1a13639 100644
--- a/src/app/controllers/provider_accounts_controller.rb
+++ b/src/app/controllers/provider_accounts_controller.rb
@@ -33,13 +33,13 @@ class ProviderAccountsController < ApplicationController
save_breadcrumb(provider_account_path(@account), @account.name)
respond_to do |format|
+ format.html { render :action => 'show'}
format.js do
if params.delete :details_pane
render :partial => 'layouts/details_pane' and return
end
render :partial => @details_tab and return
end
- format.html { render :action => 'show'}
end
end
@@ -151,16 +151,17 @@ class ProviderAccountsController < ApplicationController
@quota = Quota.new
@provider_account = ProviderAccount.new
respond_to do |format|
- format.js {
+ format.html {
@providers = Provider.find(:all)
@selected_provider = Provider.find(params[:provider_account][:provider_id])
- render :partial => 'provider_selection'
+ render :action => 'new', :layout => true
}
- format.html {
+ format.js {
@providers = Provider.find(:all)
@selected_provider = Provider.find(params[:provider_account][:provider_id])
- render :action => 'new', :layout => true
+ render :partial => 'provider_selection'
}
+
end
end
diff --git a/src/app/controllers/providers_controller.rb
b/src/app/controllers/providers_controller.rb
index 3c33ce9..92ff5fa 100644
--- a/src/app/controllers/providers_controller.rb
+++ b/src/app/controllers/providers_controller.rb
@@ -45,13 +45,13 @@ class ProvidersController < ApplicationController
save_breadcrumb(provider_path(@provider), @provider.name)
respond_to do |format|
+ format.html { render :action => 'show' }
format.js do
if params.delete :details_pane
render :partial => 'layouts/details_pane' and return
end
render :partial => @details_tab and return
end
- format.html { render :action => 'show' }
end
end
diff --git a/src/app/controllers/realms_controller.rb
b/src/app/controllers/realms_controller.rb
index 29124a4..c042d8f 100644
--- a/src/app/controllers/realms_controller.rb
+++ b/src/app/controllers/realms_controller.rb
@@ -99,13 +99,13 @@ class RealmsController < ApplicationController
save_breadcrumb(realm_path(@realm), @realm.name)
respond_to do |format|
+ format.html { render :action => 'show' }
format.js do
if params.delete :details_pane
render :partial => 'layouts/details_pane' and return
end
render :partial => @details_tab
end
- format.html { render :action => 'show' }
end
end
diff --git a/src/app/controllers/roles_controller.rb
b/src/app/controllers/roles_controller.rb
index 853fdcd..4001e3d 100644
--- a/src/app/controllers/roles_controller.rb
+++ b/src/app/controllers/roles_controller.rb
@@ -41,13 +41,13 @@ class RolesController < ApplicationController
@details_tab = params[:details_tab].blank? ? 'properties' :
params[:details_tab]
save_breadcrumb(role_path(@role), @role.name)
respond_to do |format|
+ format.html
format.js do
if params.delete :details_pane
render :partial => 'layouts/details_pane' and return
end
render :partial => @details_tab
end
- format.html
end
end
diff --git a/src/app/controllers/users_controller.rb
b/src/app/controllers/users_controller.rb
index 40c0dda..86adb50 100644
--- a/src/app/controllers/users_controller.rb
+++ b/src/app/controllers/users_controller.rb
@@ -53,13 +53,13 @@ class UsersController < ApplicationController
@tab_captions = ['Properties']
@details_tab = params[:details_tab].blank? ? 'properties' :
params[:details_tab]
respond_to do |format|
+ format.html
format.js do
if params.delete :details_pane
render :partial => 'layouts/details_pane' and return
end
render :partial => @details_tab
end
- format.html
end
end
diff --git a/src/spec/controllers/provider_controller_spec.rb
b/src/spec/controllers/provider_controller_spec.rb
deleted file mode 100644
index 775ef92..0000000
--- a/src/spec/controllers/provider_controller_spec.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-require 'spec_helper'
-
-describe ProvidersController do
-
- fixtures :all
- before(:each) do
- @admin_permission = Factory :provider_admin_permission
- @provider = @admin_permission.permission_object
- @admin = @admin_permission.user
- activate_authlogic
- end
-
- it "should provide ui to view hardware profiles" do
- UserSession.create(@admin)
- provider = @admin_permission.permission_object
-
- get :show, :id => provider.id, :details_tab => 'hw_profiles'
- response.should be_success
- assigns[:hardware_profiles].size.should == provider.hardware_profiles.size
- response.should render_template("providers/_hw_profiles")
- end
-
- it "should provide ui to view realms" do
- UserSession.create(@admin)
- provider = @admin_permission.permission_object
-
- get :show, :id => provider.id, :details_tab => 'realms'
- response.should be_success
- assigns[:realm_names].size.should == provider.realms.size
- response.should render_template("providers/_realms")
- end
-
-
-end
--
1.7.4.4