Skip to content

Commit

Permalink
Issue #82: Move the 'blocked user' test into its own feature and expa…
Browse files Browse the repository at this point in the history
…nd the test coverage.
  • Loading branch information
claudiu-cristea committed Jun 6, 2019
1 parent 5cf4058 commit b801ee2
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 15 deletions.
15 changes: 0 additions & 15 deletions tests/features/ecas-login.feature
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,3 @@ Feature: Login through OE Authentication
When I click "Log out"
And I press the "Log me out" button
Then I should be on the homepage

@cleanup:user
Scenario: A site that requires administration validation on users should block them by default
# When I try to log in again I will be denied access.
Given the site is configured to make users blocked on creation
When I am on the homepage
And I click "Log in"
And I click "European Commission"
And I fill in "Username or e-mail address" with "[email protected]"
And I fill in "Password" with "dragon_tattoo"
And I press the "Login!" button
Then I should be on the homepage
And I should see "Your account is blocked or has not been activated. Please contact a site administrator."
And I should see "Thank you for applying for an account. Your account is currently pending approval by the site administrator."
And I should see the link "Log in"
42 changes: 42 additions & 0 deletions tests/features/require-admin-approval.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
@api @javascript
Feature: As an on a site that requires registration admin approval, when
configuring the EU Login, I want to be able to decide whether users registered
via EU Login are active or blocked.

@cleanup:user @DrupalLogin @BackupAuthConfigs
Scenario: A site that requires administration validation on users should block
them by default

Given the site is configured to make users blocked on creation
And I am an anonymous user
When I am on the homepage
And I click "Log in"
And I click "EU Login"
And I click "European Commission"
And I fill in "Username or e-mail address" with "[email protected]"
And I fill in "Password" with "dragon_tattoo"
And I press the "Login!" button
Then I should be on the homepage
And I should see "Your account is blocked or has not been activated. Please contact a site administrator."
And I should see "Thank you for applying for an account. Your account is currently pending approval by the site administrator."
And I should see the link "Log in"
# Logout from EU Login.
And I click "Log in"
And I click "EU Login"
And I click "Logout"

Given I am logged in as a user with the "administer authentication configuration" permission
When I am on "the Authentication configuration page"
And I uncheck "Block newly created users if the site requires admin approval"
Then I press the "Save configuration" button

Given I am an anonymous user
When I am on the homepage
And I click "Log in"
And I click "EU Login"
And I click "European Commission"
And I fill in "Username or e-mail address" with "[email protected]"
And I fill in "Password" with "Qwerty098"
And I press the "Login!" button
Then I should be on the homepage
And I should see the link "Log out"

0 comments on commit b801ee2

Please sign in to comment.