Sha256: 727f1c6ee14925849a86a0f4f218c9a5dfe185e3b71f25799d544cb0ec3ef28f
Contents?: true
Size: 1.43 KB
Versions: 1
Compression:
Stored size: 1.43 KB
Contents
module SpecHelpers def self.request_xml_for(service, action, filename) Nokogiri::XML(File.read(xml_path_for(service, action, filename))) end def self.response_xml_for(service, action, filename) File.read(xml_path_for(service, action, filename, false)) end def self.fake_header OpenStruct.new( content: { "AuthenticationToken" => BingAdsRubySdk::LogMessage::FILTERED, "DeveloperToken" => BingAdsRubySdk::LogMessage::FILTERED, "CustomerId" => BingAdsRubySdk::LogMessage::FILTERED, "CustomerAccountId" => BingAdsRubySdk::LogMessage::FILTERED } ) end def self.soap_client(service, header = fake_header) BingAdsRubySdk::SoapClient.new( service_name: service, version: BingAdsRubySdk::DEFAULT_SDK_VERSION, environment: "test", header: header ) end def self.wrapper(service, action_name) soap_client(service).wsdl_wrapper(action_name) end def self.default_store ::BingAdsRubySdk::OAuth2::FsStore.new(ENV["BING_STORE_FILENAME"]) end # default fixture for now is standard.xml but door is open to get more use cases def self.xml_path_for(service, action, filename, request = true) if request File.join(BingAdsRubySdk.root_path, "spec", "fixtures", service.to_s, action, "#{filename}.xml") else File.join(BingAdsRubySdk.root_path, "spec", "fixtures", service.to_s, action, "#{filename}_response.xml") end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
bing_ads_ruby_sdk-1.5.0 | spec/support/spec_helpers.rb |