Sha256: 6b0fc1066dc10e3eeed1560ba9e307311722a2fa762808d6d4a137f91b3f4cfa

Contents?: true

Size: 1.52 KB

Versions: 7

Compression:

Stored size: 1.52 KB

Contents

RSpec.describe BingAdsRubySdk::Services::Bulk do

  let(:service_name) { described_class.service }
  let(:soap_client) { SpecHelpers.soap_client(service_name) }
  let(:expected_xml) { SpecHelpers.request_xml_for(service_name, action, filename) }
  let(:mocked_response) { SpecHelpers.response_xml_for(service_name, action, filename) }

  let(:service) { described_class.new(soap_client) }

  before do
    expect(BingAdsRubySdk::HttpClient).to receive(:post) do |req|
      expect(Nokogiri::XML(req.content).to_xml).to eq expected_xml.to_xml
      mocked_response
    end
  end

  describe "download_campaigns_by_account_ids" do
    let(:action) { 'download_campaigns_by_account_ids' }
    let(:filename) { 'standard' }

    it "returns expected result" do
      expect(
        service.download_campaigns_by_account_ids(
          account_ids: [{ long: 150168726 }],
          data_scope: "EntityData",
          download_file_type: "Csv",
          compression_type: "Zip",
          download_entities: [
            { download_entity: "Campaigns" }
          ],
          format_version: "6.0"
        )
      ).to eq({
        download_request_id: "618504973441"
      })
    end
  end

  describe "get_bulk_download_status" do
    let(:action) { 'get_bulk_download_status' }
    let(:filename) { 'standard' }

    it "returns expected result" do
      expect(
        service.get_bulk_download_status(request_id: 618504973441)
      ).to include(
        request_status: 'Completed',
        result_file_url: "cool_url"
      )
    end
  end
end




Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
bing_ads_ruby_sdk-1.3.4 spec/bing_ads_ruby_sdk/services/bulk_spec.rb
bing_ads_ruby_sdk-1.3.3 spec/bing_ads_ruby_sdk/services/bulk_spec.rb
bing_ads_ruby_sdk-1.3.2 spec/bing_ads_ruby_sdk/services/bulk_spec.rb
bing_ads_ruby_sdk-1.3.1 spec/bing_ads_ruby_sdk/services/bulk_spec.rb
bing_ads_ruby_sdk-1.3.0 spec/bing_ads_ruby_sdk/services/bulk_spec.rb
bing_ads_ruby_sdk-1.2.0 spec/bing_ads_ruby_sdk/services/bulk_spec.rb
bing_ads_ruby_sdk-1.1.1 spec/bing_ads_ruby_sdk/services/bulk_spec.rb