Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Feature: Export Users as CSV
- Background:
- Given a user "User 1" with:
- | id | 1 |
- | name | Alex Barnsley |
- And a user "User 2" with:
- | id | 2 |
- | name | Phil Thompson |
- And a role "Authorized" with permissions:
- | User | read |
- And user "User 1" belongs to role "Authorized"
- Scenario: Export users list as csv
- When I sign in as user "User 1"
- And I browse to users list
- Then I see "User 1"
- And I see "User 2"
- When I click "CSV"
- Then I download a CSV with content:
- | Id | Name | Username | Sign in count | Failed attempts | Last sign in at | Password changed at | Locked at | Created at | Updated at |
- | 1 | Alex Barnsley | User 1 | <INT> | <INT> | <ISO_DATE> | <ISO_DATE> | <EMPTY> | <ISO_DATE> | <ISO_DATE> |
- | 2 | Phil Thompson | User 2 | <INT> | <INT> | <EMPTY> | <ISO_DATE> | <EMPTY> | <ISO_DATE> | <ISO_DATE> |
- csv do
- column :id
- column(:name) { |user| user.object.name }
- column(:username) { |user| user.object.username }
- column :sign_in_count
- column :last_sign_in_at
- column :failed_attempts
- column :password_changed_at
- column :locked_at
- column :updated_at
- column :created_at
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement