Sha256: f5cf3e99c2a204dc1cf2e16921fa508943cb75eff3f4b1d31665d3fb2e9b2810
Contents?: true
Size: 596 Bytes
Versions: 39
Compression:
Stored size: 596 Bytes
Contents
module EgovUtils module TestUtils module ControllerHelpers def default_user(params={}) user = FactoryBot.create(:egov_utils_user, params) user end def admin_user default_user(roles: ['admin']) end def basic_user default_user(roles: ['user']) end def anonymous_user u = default_user allow(user).to receive(:persisted?).and_return(false) u end def sign_in(user = basic_user) allow(controller).to receive(:find_current_user).and_return(user) end end end end
Version data entries
39 entries across 39 versions & 1 rubygems