Commit 4fad0ace authored by Sanad Liaquat's avatar Sanad Liaquat

Use RestClient with verify_ssl: false in api_fabricator

parent 4b2569cb
# frozen_string_literal: true
require 'airborne'
require 'active_support/core_ext/object/deep_dup'
require 'capybara/dsl'
module QA
module Resource
module ApiFabricator
include Airborne
include Capybara::DSL
HTTP_STATUS_OK = 200
......@@ -56,8 +54,10 @@ module QA
end
def api_get_from(get_path)
url = Runtime::API::Request.new(api_client, get_path).url
response = get(url)
response = RestClient::Request.execute(
method: :get,
url: Runtime::API::Request.new(api_client, get_path).url,
verify_ssl: false)
unless response.code == HTTP_STATUS_OK
raise ResourceNotFoundError, "Resource at #{url} could not be found (#{response.code}): `#{response}`."
......@@ -67,9 +67,11 @@ module QA
end
def api_post
response = post(
Runtime::API::Request.new(api_client, api_post_path).url,
api_post_body)
response = RestClient::Request.execute(
method: :post,
url: Runtime::API::Request.new(api_client, api_post_path).url,
payload: api_post_body,
verify_ssl: false)
unless response.code == HTTP_STATUS_CREATED
raise ResourceFabricationFailedError, "Fabrication of #{self.class.name} using the API failed (#{response.code}) with `#{response}`."
......
......@@ -2,6 +2,7 @@
require 'forwardable'
require 'capybara/dsl'
require 'active_support/core_ext/array/extract_options'
module QA
module Resource
......
# frozen_string_literal: true
module QA
context 'Manage' do
context 'Manage', :orchestrated, :ldap_tls, :ldap_no_tls do
it 'Has LDAP user synced using group cn method' do
users = [
......@@ -85,8 +84,6 @@ module QA
resource.provider = user[:provider]
end
end
end
def create_sandbox_group_with_user(user: nil, group_name: nil)
......@@ -113,5 +110,4 @@ module QA
end
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment