-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Superadmin feature (self deletion is already a feature * Remove schema.rb from git * PR feedback
- Loading branch information
Showing
3 changed files
with
37 additions
and
66 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddSuperadminToAdmins < ActiveRecord::Migration | ||
def change | ||
add_column :admins, :superadmin, :boolean | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
Feature: Super admin deletes an admin | ||
|
||
As a super admin | ||
So that I can control other admins | ||
I want to be able to delete them | ||
|
||
Background: | ||
Given the following admin exists | ||
| name | email | password | superadmin | | ||
| Bob | supreme_ruler@aol.com | ilikcats | true | | ||
| Carol | abc@abc.com | abc | false | | ||
And I am on the login page | ||
|
||
Scenario: Super admin successfully deletes another admin | ||
When I log in as an admin with email "[email protected]" | ||
And PENDING: I press "Edit Admins" | ||
And PENDING: I follow "delete_Carol" | ||
Then PENDING: I should not see "Carol" | ||
|
||
Scenario: Regular admin cannot access the super admin page | ||
When I log in as an admin with email "[email protected]" | ||
Then PENDING: I should not see "Edit Admins" | ||
|
||
Scenario: Super Admin successfully transfers super admin ability to another | ||
When I log in as an admin with email "[email protected]" | ||
And PENDING: I press "Edit Admins" | ||
And PENDING: I choose "transfer_Carol" | ||
And PENDING: I press "Transfer" | ||
Then PENDING: I should see "Admin powers transferred!" | ||
And PENDING: I should be on the admin home page | ||
And PENDING: I should not see "Edit Admins" | ||
|