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:
Luis Ramos
2020-03-07 15:59:26 +00:00
parent e4d307fe5e
commit ffe814ce6b
3 changed files with 0 additions and 14 deletions

View File

@@ -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'

View File

@@ -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

View File

@@ -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|