mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Adapt specs to not use anonymous user
Api::BaseController#authenticate is already taking care of the unauthenticated use case when spree_current_user is nil
This commit is contained in:
@@ -22,10 +22,6 @@ feature '
|
||||
let(:shop) { create(:distributor_enterprise) }
|
||||
let!(:er) { create(:enterprise_relationship, parent: shop, child: producer1) }
|
||||
|
||||
before :each do
|
||||
use_api_as_unauthenticated_user
|
||||
end
|
||||
|
||||
before do
|
||||
product1.set_property 'Organic', 'NASAA 12345'
|
||||
product2.set_property 'Biodynamic', 'ABC123'
|
||||
|
||||
@@ -14,10 +14,6 @@ feature 'Shops', js: true do
|
||||
let!(:producer) { create(:supplier_enterprise) }
|
||||
let!(:er) { create(:enterprise_relationship, parent: distributor, child: producer) }
|
||||
|
||||
before :each do
|
||||
use_api_as_unauthenticated_user
|
||||
end
|
||||
|
||||
before do
|
||||
producer.set_producer_property 'Organic', 'NASAA 12345'
|
||||
end
|
||||
|
||||
@@ -68,12 +68,6 @@ module AuthenticationWorkflow
|
||||
fill_in "password", with: user.password
|
||||
click_button "Login"
|
||||
end
|
||||
|
||||
def use_api_as_unauthenticated_user
|
||||
allow_any_instance_of(Api::BaseController).to receive(:spree_current_user) {
|
||||
Spree::User.anonymous!
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
RSpec.configure do |config|
|
||||
|
||||
Reference in New Issue
Block a user