mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-27 21:06:49 +00:00
20 lines
469 B
Ruby
20 lines
469 B
Ruby
module Spree
|
|
module Api
|
|
module TestingSupport
|
|
module Setup
|
|
def sign_in_as_admin!
|
|
let!(:current_api_user) do
|
|
user = stub_model(Spree::LegacyUser)
|
|
user.should_receive(:has_spree_role?).any_number_of_times.with("admin").and_return(true)
|
|
|
|
# Stub enterprises, needed for cancan ability checks
|
|
user.stub(:enterprises) { [] }
|
|
|
|
user
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|