mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-21 05:09:15 +00:00
Mock current_spree_user to return a user without permissions so that the controller does not use an already loaded version of current_spree_user that still has enough permissions
This commit is contained in:
@@ -195,7 +195,8 @@ feature "
|
||||
fill_in "variant-overrides-#{variant.id}-count_on_hand", with: '123'
|
||||
expect(page).to have_content "Changes to one override remain unsaved."
|
||||
|
||||
user.enterprises.clear
|
||||
# Set a user without suficient permissions
|
||||
allow_any_instance_of(Spree::Admin::BaseController).to receive(:current_spree_user).and_return(build(:user))
|
||||
|
||||
expect do
|
||||
click_button 'Save Changes'
|
||||
|
||||
Reference in New Issue
Block a user