diff --git a/app/controllers/spree/admin/reports_controller_decorator.rb b/app/controllers/spree/admin/reports_controller_decorator.rb index 22dd41549f..038e12020a 100644 --- a/app/controllers/spree/admin/reports_controller_decorator.rb +++ b/app/controllers/spree/admin/reports_controller_decorator.rb @@ -613,7 +613,8 @@ Spree::Admin::ReportsController.class_eval do :orders_and_fulfillment => {:name => "Orders & Fulfillment Reports", :description => ''}, :customers => {:name => "Customers", :description => 'Customer details'}, :products_and_inventory => {:name => "Products & Inventory", :description => ''}, - :sales_total => { :name => "Sales Total", :description => "Sales Total For All Orders" } + :sales_total => { :name => "Sales Total", :description => "Sales Total For All Orders" }, + :users_and_enterprises => { :name => "Users & Enterprises", :description => "Enterprise Ownership & Status" } } # Return only reports the user is authorized to view. reports.select { |action| can? action, :report } diff --git a/config/routes.rb b/config/routes.rb index 6dfe7cc900..a860ec8acf 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -116,6 +116,7 @@ Spree::Core::Engine.routes.prepend do match '/admin/reports/bulk_coop' => 'admin/reports#bulk_coop', :as => "bulk_coop_admin_reports", :via => [:get, :post] match '/admin/reports/payments' => 'admin/reports#payments', :as => "payments_admin_reports", :via => [:get, :post] match '/admin/reports/orders_and_fulfillment' => 'admin/reports#orders_and_fulfillment', :as => "orders_and_fulfillment_admin_reports", :via => [:get, :post] + match '/admin/reports/users_and_enterprises' => 'admin/reports#users_and_enterprises', :as => "users_and_enterprises_admin_reports", :via => [:get, :post] match '/admin/products/bulk_edit' => 'admin/products#bulk_edit', :as => "bulk_edit_admin_products" match '/admin/orders/bulk_management' => 'admin/orders#bulk_management', :as => "admin_bulk_order_management" match '/admin/reports/products_and_inventory' => 'admin/reports#products_and_inventory', :as => "products_and_inventory_admin_reports", :via => [:get, :post] diff --git a/spec/features/admin/reports_spec.rb b/spec/features/admin/reports_spec.rb index a1f1bcfec3..327ce7590a 100644 --- a/spec/features/admin/reports_spec.rb +++ b/spec/features/admin/reports_spec.rb @@ -14,17 +14,19 @@ feature %q{ create(:distributor_enterprise) ]) end - it "should not show the Sales Total report" do + it "does not show super admin only reports" do login_to_admin_as user click_link "Reports" page.should_not have_content "Sales Total" + page.should_not have_content "Users & Enterprises" end end context "As an admin user" do - it "shows the Sales Total report" do + it "shows the super admin only reports" do login_to_admin_section click_link "Reports" page.should have_content "Sales Total" + page.should have_content "Users & Enterprises" end end end