From 3d938b345043c406752c96351d4c3a5d64a62c04 Mon Sep 17 00:00:00 2001 From: Rob Harrington Date: Wed, 22 Oct 2014 12:30:07 +1100 Subject: [PATCH] Shifting dashboard rendering from partials to templates --- app/controllers/spree/admin/overview_controller_decorator.rb | 4 ++-- ...shboard.html.haml => multi_enterprise_dashboard.html.haml} | 0 ...hboard.html.haml => single_enterprise_dashboard.html.haml} | 0 spec/controllers/spree/admin/overview_controller_spec.rb | 4 ++-- 4 files changed, 4 insertions(+), 4 deletions(-) rename app/views/spree/admin/overview/{_multi_enterprise_dashboard.html.haml => multi_enterprise_dashboard.html.haml} (100%) rename app/views/spree/admin/overview/{_single_enterprise_dashboard.html.haml => single_enterprise_dashboard.html.haml} (100%) diff --git a/app/controllers/spree/admin/overview_controller_decorator.rb b/app/controllers/spree/admin/overview_controller_decorator.rb index ddaddb5dc3..967cdf450d 100644 --- a/app/controllers/spree/admin/overview_controller_decorator.rb +++ b/app/controllers/spree/admin/overview_controller_decorator.rb @@ -7,9 +7,9 @@ Spree::Admin::OverviewController.class_eval do if spree_current_user.manages_one_enterprise? @enterprise = @enterprises.first - render partial: "single_enterprise_dashboard" + render "single_enterprise_dashboard" else - render partial: "multi_enterprise_dashboard" + render "multi_enterprise_dashboard" end end end diff --git a/app/views/spree/admin/overview/_multi_enterprise_dashboard.html.haml b/app/views/spree/admin/overview/multi_enterprise_dashboard.html.haml similarity index 100% rename from app/views/spree/admin/overview/_multi_enterprise_dashboard.html.haml rename to app/views/spree/admin/overview/multi_enterprise_dashboard.html.haml diff --git a/app/views/spree/admin/overview/_single_enterprise_dashboard.html.haml b/app/views/spree/admin/overview/single_enterprise_dashboard.html.haml similarity index 100% rename from app/views/spree/admin/overview/_single_enterprise_dashboard.html.haml rename to app/views/spree/admin/overview/single_enterprise_dashboard.html.haml diff --git a/spec/controllers/spree/admin/overview_controller_spec.rb b/spec/controllers/spree/admin/overview_controller_spec.rb index 62443c2cfb..bac96afdf1 100644 --- a/spec/controllers/spree/admin/overview_controller_spec.rb +++ b/spec/controllers/spree/admin/overview_controller_spec.rb @@ -14,7 +14,7 @@ describe Spree::Admin::OverviewController do it "renders the single enterprise dashboard" do spree_get :index - response.should render_template partial: "_single_enterprise_dashboard" + response.should render_template "single_enterprise_dashboard" end end @@ -24,7 +24,7 @@ describe Spree::Admin::OverviewController do it "renders the multi enterprise dashboard" do spree_get :index - response.should render_template partial: "_multi_enterprise_dashboard" + response.should render_template "multi_enterprise_dashboard" end end end