cy.clearLocalStorage()
})
- it('logs in successfully', function() {
+ it('logs in successfully with correct token', function() {
const active_user = this.users['active']
const active_token = this.client_auth['active']['api_token']
cy.visit('/token/?api_token='+active_token)
cy.contains('Please log in')
cy.url().should('not.contain', '/projects/')
})
+
+ it('fails to log in with no token', function() {
+ cy.visit('/token/?api_token=')
+ cy.contains('Please log in')
+ cy.url().should('not.contain', '/projects/')
+ })
+
+ it('shows login page on first visit', function() {
+ cy.visit('/')
+ cy.contains('Please log in')
+ cy.url().should('not.contain', '/projects/')
+ })
})
\ No newline at end of file