Skip to content

Instantly share code, notes, and snippets.

class AuthenticationServiceSpec extends WordSpec with MustMatchers {
"authenticate" in {
val authService = new AuthenticationService(new Mongo())
val user = User("Jack", "jack.bauer@example.com")
authService.signup(user, password = "24") must be (Success(user))
authService.login(user.email, "24") must be (Success(user))
authService.login(user.email, "25") must be (Failure("Invalid username or password."))
authService.login("jack@example.com", "24") must be (Failure("Invalid username or password."))
}
}
class AuthenticationServiceSpec extends WordSpec with MustMatchers {
“only accept valid username and password” in {
val srv = new AuthenticationService
srv.authenticate("martin", "password") must be (true)
srv.authenticate("martin", "wrong-password") must be (false)
}
}
import android.annotation.SuppressLint;
import android.content.ClipboardManager;
import android.content.ClipData;
import android.content.Context;
import android.os.Build;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import android.annotation.SuppressLint;
import android.content.ClipboardManager;
import android.content.ClipData;
import android.content.Context;
import android.os.Build;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
package com.facebook.react.modules.pasteboard;
import android.annotation.SuppressLint;
import android.content.ClipboardManager;
import android.content.ClipData;
import android.content.Context;
import android.os.Build;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContext;
package com.facebook.react.shell;
import javax.annotation.Nullable;
import java.util.Collections;
import java.util.List;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
package com.facebook.react.shell;
import javax.annotation.Nullable;
import java.util.Collections;
import java.util.List;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
The RedBox implementation uses TYPE_SYSTEM_ALERT windows, which require
the SYSTEM_ALERT_WINDOW permission. This permission is seen as 'above dangerous'
in android M and cannot be requested through the runtime permission system (more
details here:
https://code.google.com/p/android-developer-preview/issues/detail?id=2971).
In Android M, this permission is now ignored even when listed in the manifest.
Instead, we can fire an intent to the settings menu where the user can enable
this setting for react-native apps. An alternative approach is to find a better
java.lang.RuntimeException: Failed to instantiate DeepCloner. The DeepCloner implementation must have a one-arg constructor taking a Classloader as parameter.
at org.powermock.classloading.ClassloaderExecutor.createDeepCloner(ClassloaderExecutor.java:111)
at org.powermock.classloading.ClassloaderExecutor.execute(ClassloaderExecutor.java:88)
at org.powermock.classloading.ClassloaderExecutor.execute(ClassloaderExecutor.java:78)
at org.powermock.modules.junit4.rule.PowerMockStatement.evaluate(PowerMockRule.java:62)
at org.powermock.modules.junit4.rule.PowerMockStatement$1.run(PowerMockRule.java:65)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
/**
* Copyright 2004-present Facebook. All Rights Reserved.
*
* @providesModule RKModal
* @flow
*/
'use strict';
var Portal = require('Portal');
var React = require('React');