Sha256: 7b7912958611f23e4876a525703b8d5a29533094492212340cfa0741c4b10cc1
Contents?: true
Size: 602 Bytes
Versions: 13
Compression:
Stored size: 602 Bytes
Contents
module Alchemy module TestSupport # Helpers for authentication # module AuthHelpers def sign_in(user = admin_user) allow(controller).to receive(:current_alchemy_user).and_return user end def member_user mock_user([:member]) end def author_user mock_user([:author]) end def editor_user mock_user([:editor]) end def admin_user mock_user([:admin]) end def mock_user(roles) mock_model(Alchemy.user_class, alchemy_roles: roles.map(&:to_sym)) end end end end
Version data entries
13 entries across 13 versions & 1 rubygems