Sha256: 67313d034a1259f7ad3eb0dfa8ff21a63e8f915deee0e507f6ac87a43e1f8d90
Contents?: true
Size: 713 Bytes
Versions: 16
Compression:
Stored size: 713 Bytes
Contents
require 'spec_helper' include Warden::Test::Helpers module Gaku::Testing::AuthHelpers module Controller def as(user) @request.env['devise.mapping'] = ::Devise.mappings[:admin] if user == 'admin' sign_in create("#{user.to_sym}_user") end end module Feature def as(user) if user.is_a?(Symbol) login_as create("#{user.to_sym}_user"), scope: :user else login_as user, scope: :user end end end end RSpec.configure do |config| config.include Gaku::Testing::AuthHelpers::Controller, type: :controller config.include Gaku::Testing::AuthHelpers::Feature, type: :request config.include Gaku::Testing::AuthHelpers::Feature, type: :feature end
Version data entries
16 entries across 16 versions & 2 rubygems