mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-14 04:04:23 +00:00
Switch object in the ability to access reports. This adapts to this change in Spree: 3685569db4
Adapt NavigationHelper to return the controller object for reports so that Reports tab works correctly.
This commit is contained in:
@@ -214,13 +214,13 @@ module Spree
|
||||
end
|
||||
|
||||
it "should be able to read some reports" do
|
||||
should have_ability([:admin, :index, :customers, :bulk_coop, :orders_and_fulfillment, :products_and_inventory, :order_cycle_management], for: :report)
|
||||
should have_ability([:admin, :index, :customers, :bulk_coop, :orders_and_fulfillment, :products_and_inventory, :order_cycle_management], for: Spree::Admin::ReportsController)
|
||||
end
|
||||
|
||||
include_examples "allows access to Enterprise Fee Summary only if feature flag enabled"
|
||||
|
||||
it "should not be able to read other reports" do
|
||||
should_not have_ability([:sales_total, :group_buys, :payments, :orders_and_distributors, :users_and_enterprises, :xero_invoices], for: :report)
|
||||
should_not have_ability([:sales_total, :group_buys, :payments, :orders_and_distributors, :users_and_enterprises, :xero_invoices], for: Spree::Admin::ReportsController)
|
||||
end
|
||||
|
||||
it "should not be able to access customer actions" do
|
||||
@@ -407,13 +407,13 @@ module Spree
|
||||
end
|
||||
|
||||
it "should be able to read some reports" do
|
||||
should have_ability([:admin, :index, :customers, :sales_tax, :group_buys, :bulk_coop, :payments, :orders_and_distributors, :orders_and_fulfillment, :products_and_inventory, :order_cycle_management, :xero_invoices], for: :report)
|
||||
should have_ability([:admin, :index, :customers, :sales_tax, :group_buys, :bulk_coop, :payments, :orders_and_distributors, :orders_and_fulfillment, :products_and_inventory, :order_cycle_management, :xero_invoices], for: Spree::Admin::ReportsController)
|
||||
end
|
||||
|
||||
include_examples "allows access to Enterprise Fee Summary only if feature flag enabled"
|
||||
|
||||
it "should not be able to read other reports" do
|
||||
should_not have_ability([:sales_total, :users_and_enterprises], for: :report)
|
||||
should_not have_ability([:sales_total, :users_and_enterprises], for: Spree::Admin::ReportsController)
|
||||
end
|
||||
|
||||
it "should be able to access customer actions" do
|
||||
|
||||
Reference in New Issue
Block a user