25 lines
840 B
Gherkin
25 lines
840 B
Gherkin
Feature: Authentication
|
|
|
|
Scenario: Redirect unauthenticated user to login
|
|
Given I visit "/companies"
|
|
Then the URL contains "/login"
|
|
|
|
Scenario: Successful login redirects to companies
|
|
Given I visit "/login"
|
|
When I fill "input[type='email']" with "founder@example.com"
|
|
And I fill "input[type='password']" with "test1234"
|
|
And I click "Sign in"
|
|
Then the URL contains "/companies"
|
|
|
|
Scenario: Wrong password shows an error
|
|
Given I visit "/login"
|
|
When I fill "input[type='email']" with "founder@example.com"
|
|
And I fill "input[type='password']" with "wrongpassword"
|
|
And I click "Sign in"
|
|
Then I see "Email or password is incorrect"
|
|
|
|
Scenario: Logged-in user can log out
|
|
Given I am logged in as "founder@example.com" with password "test1234"
|
|
When I log out
|
|
Then I see "Signed out"
|