Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
647c9a55
Commit
647c9a55
authored
Dec 10, 2019
by
manojmj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add feature specs for ‘Credentials Inventory’
parent
a98b8302
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
83 additions
and
0 deletions
+83
-0
ee/spec/features/admin/admin_credentials_inventory_spec.rb
ee/spec/features/admin/admin_credentials_inventory_spec.rb
+83
-0
No files found.
ee/spec/features/admin/admin_credentials_inventory_spec.rb
0 → 100644
View file @
647c9a55
# frozen_string_literal: true
require
'spec_helper'
describe
'Admin::CredentialsInventory'
do
include
Spec
::
Support
::
Helpers
::
Features
::
ResponsiveTableHelpers
before
do
sign_in
(
create
(
:admin
))
end
context
'unlicensed'
do
before
do
stub_licensed_features
(
credentials_inventory:
false
)
end
it
'returns 404'
do
visit
admin_credentials_path
expect
(
page
.
status_code
).
to
eq
(
404
)
end
end
context
'licensed'
do
before
do
stub_licensed_features
(
credentials_inventory:
true
)
end
context
'links'
do
before
do
visit
admin_credentials_path
end
it
'has Credentials Inventory link in sidebar'
do
expect
(
page
).
to
have_link
(
'Credentials'
,
href:
admin_credentials_path
)
end
context
'tabs'
do
it
'contains the relevant filter tabs'
do
expect
(
page
).
to
have_link
(
'Personal Access Tokens'
,
href:
admin_credentials_path
(
filter:
'personal_access_tokens'
))
expect
(
page
).
to
have_link
(
'SSH Keys'
,
href:
admin_credentials_path
(
filter:
'ssh_keys'
))
end
end
end
context
'filtering'
do
context
'by Personal Access Tokens'
do
before
do
create
(
:personal_access_token
,
user:
create
(
:user
,
name:
'David'
),
created_at:
'2019-12-10'
,
expires_at:
nil
)
visit
admin_credentials_path
(
filter:
'personal_access_tokens'
)
end
it
'shows details of personal access tokens'
do
expect
(
first_row
.
text
).
to
include
(
'David'
)
expect
(
first_row
.
text
).
to
include
(
'api'
)
expect
(
first_row
.
text
).
to
include
(
'2019-12-10'
)
expect
(
first_row
.
text
).
to
include
(
'Never'
)
end
end
context
'by SSH Keys'
do
before
do
create
(
:personal_key
,
user:
create
(
:user
,
name:
'Tom'
),
created_at:
'2019-12-09'
,
last_used_at:
'2019-12-10'
)
visit
admin_credentials_path
(
filter:
'ssh_keys'
)
end
it
'shows details of ssh keys'
do
expect
(
first_row
.
text
).
to
include
(
'Tom'
)
expect
(
first_row
.
text
).
to
include
(
'2019-12-09'
)
expect
(
first_row
.
text
).
to
include
(
'2019-12-10'
)
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment