                         Keyboard.shared().topEdge = screenHeight - 100.0
                         postNotification(Keyboard.Notifications.KeyboardWillShow, Keyboard.shared())
 
-                        expect(controller.scrollView.contentInset.bottom) == 0
+                        expect(subject.scrollView.contentInset.bottom) == 0
                     }
                 }
             }

                        Keyboard.shared().topEdge = screenHeight - 303.0
                        postNotification(Keyboard.Notifications.KeyboardWillShow, Keyboard.shared())

                        expect(controller.scrollView.contentInset.bottom) > 50
                    }
                }


            context("passwordTextField") {

                it("is properly configured") {
                    expect(subject.passwordTextField.keyboardType.rawValue) == UIKeyboardType.Default.rawValue
                    expect(subject.passwordTextField.returnKeyType.rawValue) == UIReturnKeyType.Go.rawValue
                    expect(subject.passwordTextField.secureTextEntry) == true
                }

                it("has controller as delegate") {
                    expect(subject.passwordTextField.delegate) === subject
                }
            }
        }

        describe("-viewDidLoad") {

            it("has a cross dissolve modal transition style") {
                expect(subject.modalTransitionStyle.rawValue) == UIModalTransitionStyle.CrossDissolve.rawValue
            }

            it("has a disabled enter button") {
                expect(subject.enterButton.enabled) == false
            }
        }

        describe("IBActions") {
            describe("enterTapped") {

                it("dismisses the keyboard") {
                    subject.emailTextField.becomeFirstResponder()
                    subject.enterTapped(subject.enterButton)
                    expect(subject.emailTextField.isFirstResponder()) == false


                    subject.passwordTextField.becomeFirstResponder()
                    subject.enterTapped(subject.enterButton)
                    expect(subject.passwordTextField.isFirstResponder()) == false
                }

                context("input is valid") {

                    it("disables input") {
                        subject.emailTextField.text = "name@example.com"
                        subject.passwordTextField.text = "12345678"

                        subject.enterTapped(subject.enterButton)
                        expect(subject.emailTextField.enabled) == false
                        expect(subject.passwordTextField.enabled) == false
                        expect(subject.enterButton.enabled) == false
                        expect(subject.view.userInteractionEnabled) == false
                    }

                }

                context("input is invalid") {

                    it("does not disable input") {
                        subject.emailTextField.text = "invalid email"
                        subject.passwordTextField.text = "abc"

                        subject.enterTapped(subject.enterButton)
                        expect(subject.emailTextField.enabled) == true
                        expect(subject.passwordTextField.enabled) == true
                        expect(subject.enterButton.enabled) == false
                        expect(subject.view.userInteractionEnabled) == true
                    }
                }
            }
        }

        describe("notifications") {

            describe("UIKeyboardWillShowNotification") {

