Sha256: 0cb744205fc39155c63b91caade56587338f12ccd9b05deabe06421dd1f89e8a
Contents?: true
Size: 1.03 KB
Versions: 6
Compression:
Stored size: 1.03 KB
Contents
def admin_user @admin ||= instance_double(Symphonia::User, id: 1, admin: true, admin?: true, authorize?: true, logged_in?: true, allowed_to?: true, persistence_token: SecureRandom.hex(12) ) end def regular_user # @user ||= instance_double(Symphonia::User, # id: 2, # admin: false, # admin?: false, # authorize?: false, # logged_in?: true, # allowed_to?: false, # persistence_token: SecureRandom.hex(12) # ) @user ||= FactoryBot.build_stubbed :user end def add_permission *args @role ||= FactoryBot.build_stubbed :role @role.permissions = args regular_user.role = @role # allow(regular_user).to receive(:role).and_return @role @role end
Version data entries
6 entries across 6 versions & 1 rubygems