/*
 * Copyright 2012 GitHub Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.github.mobile.tests.user;

import android.accounts.AccountManager;
import android.view.View;
import android.widget.EditText;

import com.github.mobile.R.id;
import com.github.mobile.accounts.AccountUtils;
import com.github.mobile.accounts.LoginActivity;
import com.github.mobile.tests.ActivityTest;

/**
 * Tests of {@link LoginActivity}
 */
public class LoginActivityTest extends ActivityTest<LoginActivity> {

    /**
     * Create navigation_drawer_header_background for {@link LoginActivity}
     */
    public LoginActivityTest() {
        super(LoginActivity.class);
    }

    /**
     * Verify authenticator is registered
     */
    public void testHasAuthenticator() {
        assertTrue(AccountUtils.hasAuthenticator(AccountManager
            .get(getActivity())));
    }

    /**
     * Verify activity was created successfully
     *
     * @throws Throwable
     */
    public void testSignInIsDisabled() throws Throwable {
        View loginMenu = view(id.m_login);
        assertFalse(loginMenu.isEnabled());
        final EditText login = editText(id.et_login);
        final EditText password = editText(id.et_password);
        focus(login);
        send("loginname");
        assertEquals("loginname", login.getText().toString());
        assertFalse(loginMenu.isEnabled());
        focus(password);
        send("password");
        assertEquals("password", password.getText().toString());
        assertTrue(loginMenu.isEnabled());
    }
}

@@ -668,97 +668,8 @@
 er;%0A
-import android.view.View;%0Aimport android.widget.EditText;%0A%0Aimport com.github.mobile.R.id;
 %0Aimp
@@ -1297,682 +1297,6 @@
  %7D%0A%0A
-    /**%0A     * Verify activity was created successfully%0A     *%0A     * @throws Throwable%0A     */%0A    public void testSignInIsDisabled() throws Throwable %7B%0A        View loginMenu = view(id.m_login);%0A        assertFalse(loginMenu.isEnabled());%0A        final EditText login = editText(id.et_login);%0A        final EditText password = editText(id.et_password);%0A        focus(login);%0A        send(%22loginname%22);%0A        assertEquals(%22loginname%22, login.getText().toString());%0A        assertFalse(loginMenu.isEnabled());%0A        focus(password);%0A        send(%22password%22);%0A        assertEquals(%22password%22, password.getText().toString());%0A        assertTrue(loginMenu.isEnabled());%0A    %7D%0A
 %7D%0A

Remove old test