This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.")) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Copyright 2004-present Facebook. All Rights Reserved. | |
* | |
* @providesModule RKModal | |
* @flow | |
*/ | |
'use strict'; | |
var Portal = require('Portal'); | |
var React = require('React'); |
OlderNewer