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
968f1e9a
Commit
968f1e9a
authored
Aug 12, 2021
by
peterhegman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DRY up RSpec shared example
Per reviewer feedback
parent
7953fb39
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
spec/support/shared_examples/features/manage_applications_shared_examples.rb
..._examples/features/manage_applications_shared_examples.rb
+11
-8
No files found.
spec/support/shared_examples/features/manage_applications_shared_examples.rb
View file @
968f1e9a
...
...
@@ -15,10 +15,7 @@ RSpec.shared_examples 'manage applications' do
check
:doorkeeper_application_scopes_read_user
click_on
'Save application'
expect
(
page
).
to
have_content
application_name
expect
(
page
).
to
have_content
'Application ID'
expect
(
page
).
to
have_content
'Secret'
expect
(
page
).
to
have_content
'Confidential Yes'
validate_application
(
application_name
,
'Yes'
)
application
=
Doorkeeper
::
Application
.
find_by
(
name:
application_name
)
expect
(
page
).
to
have_css
(
"button[title=
\"
Copy secret
\"
][data-clipboard-text=
\"
#{
application
.
secret
}
\"
]"
,
text:
'Copy'
)
...
...
@@ -31,10 +28,7 @@ RSpec.shared_examples 'manage applications' do
uncheck
:doorkeeper_application_confidential
click_on
'Save application'
expect
(
page
).
to
have_content
application_name_changed
expect
(
page
).
to
have_content
'Application ID'
expect
(
page
).
to
have_content
'Secret'
expect
(
page
).
to
have_content
'Confidential No'
validate_application
(
application_name_changed
,
'No'
)
visit_applications_path
...
...
@@ -61,4 +55,13 @@ RSpec.shared_examples 'manage applications' do
def
visit_applications_path
visit
defined?
(
applications_path
)
?
applications_path
:
new_application_path
end
def
validate_application
(
name
,
confidential
)
aggregate_failures
do
expect
(
page
).
to
have_content
name
expect
(
page
).
to
have_content
'Application ID'
expect
(
page
).
to
have_content
'Secret'
expect
(
page
).
to
have_content
"Confidential
#{
confidential
}
"
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