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
iv
gitlab-ce
Commits
a1295d8e
Commit
a1295d8e
authored
Jun 03, 2016
by
Timothy Andrew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't use `natve['innerHTML']` in the feature spec.
- The `have_text` matcher works fine.
parent
4d50d8a6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
spec/features/profiles/personal_access_tokens_spec.rb
spec/features/profiles/personal_access_tokens_spec.rb
+11
-11
No files found.
spec/features/profiles/personal_access_tokens_spec.rb
View file @
a1295d8e
...
@@ -4,15 +4,15 @@ describe 'Profile > Personal Access Tokens', feature: true, js: true do
...
@@ -4,15 +4,15 @@ describe 'Profile > Personal Access Tokens', feature: true, js: true do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
def
active_personal_access_tokens
def
active_personal_access_tokens
find
(
".table.active-personal-access-tokens"
)
.
native
[
'innerHTML'
]
find
(
".table.active-personal-access-tokens"
)
end
end
def
inactive_personal_access_tokens
def
inactive_personal_access_tokens
find
(
".table.inactive-personal-access-tokens"
)
.
native
[
'innerHTML'
]
find
(
".table.inactive-personal-access-tokens"
)
end
end
def
created_personal_access_token
def
created_personal_access_token
find
(
".created-personal-access-token pre"
)
.
native
[
'innerHTML'
]
find
(
".created-personal-access-token pre"
)
end
end
before
do
before
do
...
@@ -25,9 +25,9 @@ describe 'Profile > Personal Access Tokens', feature: true, js: true do
...
@@ -25,9 +25,9 @@ describe 'Profile > Personal Access Tokens', feature: true, js: true do
fill_in
"Name"
,
with:
FFaker
::
Product
.
brand
fill_in
"Name"
,
with:
FFaker
::
Product
.
brand
expect
{
click_on
"Add Personal Access Token"
}.
to
change
{
PersonalAccessToken
.
count
}.
by
(
1
)
expect
{
click_on
"Add Personal Access Token"
}.
to
change
{
PersonalAccessToken
.
count
}.
by
(
1
)
expect
(
created_personal_access_token
).
to
eq
(
PersonalAccessToken
.
last
.
token
)
expect
(
created_personal_access_token
).
to
have_text
(
PersonalAccessToken
.
last
.
token
)
expect
(
active_personal_access_tokens
).
to
match
(
PersonalAccessToken
.
last
.
name
)
expect
(
active_personal_access_tokens
).
to
have_text
(
PersonalAccessToken
.
last
.
name
)
expect
(
active_personal_access_tokens
).
to
match
(
"Never"
)
expect
(
active_personal_access_tokens
).
to
have_text
(
"Never"
)
end
end
it
"allows creation of a token with an expiry date"
do
it
"allows creation of a token with an expiry date"
do
...
@@ -39,9 +39,9 @@ describe 'Profile > Personal Access Tokens', feature: true, js: true do
...
@@ -39,9 +39,9 @@ describe 'Profile > Personal Access Tokens', feature: true, js: true do
click_on
"1"
click_on
"1"
expect
{
click_on
"Add Personal Access Token"
}.
to
change
{
PersonalAccessToken
.
count
}.
by
(
1
)
expect
{
click_on
"Add Personal Access Token"
}.
to
change
{
PersonalAccessToken
.
count
}.
by
(
1
)
expect
(
created_personal_access_token
).
to
eq
(
PersonalAccessToken
.
last
.
token
)
expect
(
created_personal_access_token
).
to
have_text
(
PersonalAccessToken
.
last
.
token
)
expect
(
active_personal_access_tokens
).
to
match
(
PersonalAccessToken
.
last
.
name
)
expect
(
active_personal_access_tokens
).
to
have_text
(
PersonalAccessToken
.
last
.
name
)
expect
(
active_personal_access_tokens
).
to
match
(
Date
.
today
.
next_month
.
at_beginning_of_month
.
to_s
(
:medium
))
expect
(
active_personal_access_tokens
).
to
have_text
(
Date
.
today
.
next_month
.
at_beginning_of_month
.
to_s
(
:medium
))
end
end
end
end
...
@@ -51,14 +51,14 @@ describe 'Profile > Personal Access Tokens', feature: true, js: true do
...
@@ -51,14 +51,14 @@ 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
match
(
personal_access_token
.
name
)
expect
(
inactive_personal_access_tokens
).
to
have_text
(
personal_access_token
.
name
)
end
end
it
"moves expired tokens to the 'inactive' section"
do
it
"moves expired tokens to the 'inactive' section"
do
personal_access_token
=
create
(
:personal_access_token
,
expires_at:
5
.
days
.
ago
,
user:
user
)
personal_access_token
=
create
(
:personal_access_token
,
expires_at:
5
.
days
.
ago
,
user:
user
)
visit
profile_personal_access_tokens_path
visit
profile_personal_access_tokens_path
expect
(
inactive_personal_access_tokens
).
to
match
(
personal_access_token
.
name
)
expect
(
inactive_personal_access_tokens
).
to
have_text
(
personal_access_token
.
name
)
end
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