Created
July 8, 2014 15:03
-
-
Save dmackerman/f496020f158da30fa87c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
describe('productizer.io : login & register', function() { | |
beforeEach(function () { | |
var productizer = require('../productizer.js'); | |
productizer.get(); | |
}); | |
it('should allow user to successfully log in and out', function() { | |
productizer.login('[email protected]', 'ferrari0'); | |
expect(productizer.pageHeader.getText()).toContain('Dashboard'); | |
productizer.logout(); | |
expect(productizer.loginContentArea.getText()).toContain('An Intraprenuers\' tool for Lean-a-fying the Enterprise'); | |
}); | |
it("should verify that the registration email & password field is a required field", function() { | |
expect(productizer.userEmailField.getAttribute('required')).toEqual('true'); | |
expect(productizer.userPasswordField.getAttribute('required')).toEqual('true'); | |
expect(productizer.userRegisterField.getAttribute('required')).toEqual('true'); | |
expect(productizer.userRegisterPasswordField.getAttribute('required')).toEqual('true'); | |
}); | |
it("should show an error for an invalid login", function() { | |
productizer.login('[email protected]', 'foobar'); | |
expect(productizer.loginErrorContainer.getText()).toBe(productizer.errorMessages.invalidLogin); | |
}); | |
it("should not let a user register if they already registered", function() { | |
productizer.register('[email protected]', 'ferrari'); | |
expect(productizer.loginErrorContainer.getText()).toBe(productizer.errorMessages.alreadyRegistered); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment