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
6897f206
Commit
6897f206
authored
Nov 19, 2018
by
Sanad Liaquat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use RestClient directly instead of airborne
parent
f6e54708
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
27 deletions
+36
-27
qa/qa.rb
qa/qa.rb
+1
-0
qa/qa/resource/api_fabricator.rb
qa/qa/resource/api_fabricator.rb
+1
-24
qa/qa/specs/features/browser_ui/1_manage/ee_group/group_ldap_sync_spec.rb
...ures/browser_ui/1_manage/ee_group/group_ldap_sync_spec.rb
+6
-3
qa/qa/support/api.rb
qa/qa/support/api.rb
+28
-0
No files found.
qa/qa.rb
View file @
6897f206
...
...
@@ -329,6 +329,7 @@ module QA
module
Page
autoload
:Logging
,
'qa/support/page/logging'
end
autoload
:Api
,
'qa/support/api'
end
end
...
...
qa/qa/resource/api_fabricator.rb
View file @
6897f206
...
...
@@ -40,7 +40,7 @@ module QA
end
private
include
Support
::
Api
attr_writer
:api_resource
,
:api_response
def
resource_web_url
(
resource
)
...
...
@@ -82,10 +82,6 @@ module QA
end
end
def
parse_body
(
response
)
JSON
.
parse
(
response
.
body
,
symbolize_names:
true
)
end
def
process_api_response
(
parsed_response
)
self
.
api_response
=
parsed_response
self
.
api_resource
=
transform_api_resource
(
parsed_response
.
deep_dup
)
...
...
@@ -94,25 +90,6 @@ module QA
def
transform_api_resource
(
api_resource
)
api_resource
end
def
post
(
url
,
payload
)
RestClient
::
Request
.
execute
(
method: :post
,
url:
url
,
payload:
payload
,
verify_ssl:
false
)
rescue
RestClient
::
ExceptionWithResponse
=>
e
e
.
response
end
def
get
(
url
)
RestClient
::
Request
.
execute
(
method: :get
,
url:
url
,
verify_ssl:
false
)
rescue
RestClient
::
ExceptionWithResponse
=>
e
e
.
response
end
end
end
end
qa/qa/specs/features/browser_ui/1_manage/ee_group/group_ldap_sync_spec.rb
View file @
6897f206
...
...
@@ -3,6 +3,8 @@
module
QA
context
'Manage'
,
:orchestrated
,
:ldap_tls
,
:ldap_no_tls
do
describe
'LDAP Group sync'
do
include
Support
::
Api
before
(
:all
)
do
users
=
[
{
...
...
@@ -52,7 +54,7 @@ module QA
EE
::
Page
::
Group
::
Menu
.
perform
(
&
:go_to_members
)
verify_users_synced
([
'ENG User 2'
,
'ENG
U
ser 3'
])
verify_users_synced
([
'ENG User 2'
,
'ENG ser 3'
])
end
it
'Has LDAP user synced using user filter method'
do
...
...
@@ -89,8 +91,9 @@ module QA
def
add_user_to_sandbox_group_via_api
(
user
)
sandbox_group_path
=
Resource
::
Sandbox
.
fabricate_via_api!
.
path
api_client
=
Runtime
::
API
::
Client
.
new
(
:gitlab
,
personal_access_token:
Runtime
::
Env
.
personal_access_token
)
get
Runtime
::
API
::
Request
.
new
(
api_client
,
"/users?username=
#{
user
}
"
).
url
post
Runtime
::
API
::
Request
.
new
(
api_client
,
"/groups/
#{
sandbox_group_path
}
/members"
).
url
,
user_id:
json_body
.
first
[
:id
],
access_level:
'50'
response
=
get
Runtime
::
API
::
Request
.
new
(
api_client
,
"/users?username=
#{
user
}
"
).
url
post
Runtime
::
API
::
Request
.
new
(
api_client
,
"/groups/
#{
sandbox_group_path
}
/members"
).
url
,
{
user_id:
parse_body
(
response
).
first
[
:id
],
access_level:
'50'
}
end
def
create_admin_personal_access_token
...
...
qa/qa/support/api.rb
0 → 100644
View file @
6897f206
module
QA
module
Support
module
Api
def
post
(
url
,
payload
)
RestClient
::
Request
.
execute
(
method: :post
,
url:
url
,
payload:
payload
,
verify_ssl:
false
)
rescue
RestClient
::
ExceptionWithResponse
=>
e
e
.
response
end
def
get
(
url
)
RestClient
::
Request
.
execute
(
method: :get
,
url:
url
,
verify_ssl:
false
)
rescue
RestClient
::
ExceptionWithResponse
=>
e
e
.
response
end
def
parse_body
(
response
)
JSON
.
parse
(
response
.
body
,
symbolize_names:
true
)
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