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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
ba1dca79
Commit
ba1dca79
authored
Jul 14, 2017
by
kushalpandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update tests to cover removal of inactive tokens table
parent
aca213ad
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
spec/features/admin/admin_users_impersonation_tokens_spec.rb
spec/features/admin/admin_users_impersonation_tokens_spec.rb
+6
-4
spec/features/profiles/personal_access_tokens_spec.rb
spec/features/profiles/personal_access_tokens_spec.rb
+7
-5
No files found.
spec/features/admin/admin_users_impersonation_tokens_spec.rb
View file @
ba1dca79
...
@@ -8,8 +8,8 @@ describe 'Admin > Users > Impersonation Tokens', feature: true, js: true do
...
@@ -8,8 +8,8 @@ describe 'Admin > Users > Impersonation Tokens', feature: true, js: true do
find
(
".table.active-tokens"
)
find
(
".table.active-tokens"
)
end
end
def
inactive_impersonation_tokens
def
no_personal_access_tokens_message
find
(
".
table.inactive-tokens
"
)
find
(
".
settings-message
"
)
end
end
before
do
before
do
...
@@ -60,7 +60,8 @@ describe 'Admin > Users > Impersonation Tokens', feature: true, js: true do
...
@@ -60,7 +60,8 @@ describe 'Admin > Users > Impersonation Tokens', feature: true, js: true do
click_on
"Revoke"
click_on
"Revoke"
expect
(
inactive_impersonation_tokens
).
to
have_text
(
impersonation_token
.
name
)
expect
(
page
).
to
have_selector
(
".settings-message"
)
expect
(
no_personal_access_tokens_message
).
to
have_text
(
"This user has no active Impersonation Tokens."
)
end
end
it
"moves expired tokens to the 'inactive' section"
do
it
"moves expired tokens to the 'inactive' section"
do
...
@@ -68,7 +69,8 @@ describe 'Admin > Users > Impersonation Tokens', feature: true, js: true do
...
@@ -68,7 +69,8 @@ describe 'Admin > Users > Impersonation Tokens', feature: true, js: true do
visit
admin_user_impersonation_tokens_path
(
user_id:
user
.
username
)
visit
admin_user_impersonation_tokens_path
(
user_id:
user
.
username
)
expect
(
inactive_impersonation_tokens
).
to
have_text
(
impersonation_token
.
name
)
expect
(
page
).
to
have_selector
(
".settings-message"
)
expect
(
no_personal_access_tokens_message
).
to
have_text
(
"This user has no active Impersonation Tokens."
)
end
end
end
end
end
end
spec/features/profiles/personal_access_tokens_spec.rb
View file @
ba1dca79
...
@@ -7,8 +7,8 @@ describe 'Profile > Personal Access Tokens', feature: true, js: true do
...
@@ -7,8 +7,8 @@ describe 'Profile > Personal Access Tokens', feature: true, js: true do
find
(
".table.active-tokens"
)
find
(
".table.active-tokens"
)
end
end
def
inactive_personal_access_tokens
def
no_personal_access_tokens_message
find
(
".
table.inactive-tokens
"
)
find
(
".
settings-message
"
)
end
end
def
created_personal_access_token
def
created_personal_access_token
...
@@ -80,14 +80,16 @@ describe 'Profile > Personal Access Tokens', feature: true, js: true do
...
@@ -80,14 +80,16 @@ describe 'Profile > Personal Access Tokens', feature: true, js: true do
visit
profile_personal_access_tokens_path
visit
profile_personal_access_tokens_path
click_on
"Revoke"
click_on
"Revoke"
expect
(
inactive_personal_access_tokens
).
to
have_text
(
personal_access_token
.
name
)
expect
(
page
).
to
have_selector
(
".settings-message"
)
expect
(
no_personal_access_tokens_message
).
to
have_text
(
"This user has no active Personal Access Tokens."
)
end
end
it
"
moves expired tokens to the 'in
active' section"
do
it
"
removes expired tokens from '
active' section"
do
personal_access_token
.
update
(
expires_at:
5
.
days
.
ago
)
personal_access_token
.
update
(
expires_at:
5
.
days
.
ago
)
visit
profile_personal_access_tokens_path
visit
profile_personal_access_tokens_path
expect
(
inactive_personal_access_tokens
).
to
have_text
(
personal_access_token
.
name
)
expect
(
page
).
to
have_selector
(
".settings-message"
)
expect
(
no_personal_access_tokens_message
).
to
have_text
(
"This user has no active Personal Access Tokens."
)
end
end
context
"when revocation fails"
do
context
"when revocation fails"
do
...
...
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