mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-05 02:41:33 +00:00
WIP: BOM Refactor, adding for_line_items action to enterprises controller
This commit is contained in:
@@ -515,6 +515,21 @@ module Admin
|
||||
end
|
||||
end
|
||||
|
||||
describe "for_line_items" do
|
||||
let!(:user) { create(:user) }
|
||||
let!(:enterprise) { create(:enterprise, sells: 'any', owner: user) }
|
||||
|
||||
before do
|
||||
# As a user with permission
|
||||
controller.stub spree_current_user: user
|
||||
end
|
||||
|
||||
it "initializes permissions with the existing OrderCycle" do
|
||||
# expect(controller).to receive(:render_as_json).with([enterprise], {ams_prefix: 'basic', spree_current_user: user})
|
||||
spree_get :for_line_items, format: :json
|
||||
end
|
||||
end
|
||||
|
||||
describe "index" do
|
||||
context "as super admin" do
|
||||
let(:super_admin) { create(:admin_user) }
|
||||
|
||||
@@ -90,7 +90,7 @@ describe Spree::Admin::BaseController do
|
||||
before do
|
||||
class Api::Admin::AllowedPrefixAnonymouSerializer;end;
|
||||
class Api::Admin::AnonymouSerializer;end;
|
||||
allow(controller).to receive(:ams_prefix_whitelist) { ['allowed_prefix'] }
|
||||
allow(controller).to receive(:ams_prefix_whitelist) { [:allowed_prefix] }
|
||||
end
|
||||
|
||||
context "when a prefix is passed in" do
|
||||
|
||||
Reference in New Issue
Block a user