Sha256: a0b60732dc808e57a82a26417731b15a793857389fecb2f318a1f91731b629aa
Contents?: true
Size: 482 Bytes
Versions: 5
Compression:
Stored size: 482 Bytes
Contents
module ControllerMacros def login_admin before(:each) do @request.env["devise.mapping"] = Devise.mappings[:user] sign_in FactoryBot.create(:admin) end end def login_customer before(:each) do @request.env["devise.mapping"] = Devise.mappings[:user] customer = FactoryBot.create(:customer) # customer.confirm! sign_in customer end end end RSpec.configure do |config| config.extend ControllerMacros, type: :controller end
Version data entries
5 entries across 5 versions & 1 rubygems